• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1require 'hdf'
2
3module Clearsilver
4
5  class Hdf < Neo::Hdf
6
7    def initialize
8      super
9      @level=0
10      @cpos=""
11      @position=[]
12    end
13
14    attr_reader :position, :cpos
15
16    def push name
17      @position.push(@cpos)
18      @cpos+=name+"."
19
20      if block_given?
21	yield
22	@cpos=@position.pop
23      end
24    end
25
26    def pop
27      @cpos=@position.pop
28    end
29
30    def put name, value
31      value = value.to_s unless value.is_a?(String)
32      self.set_value(@cpos+(name.to_s),value)
33    end
34
35    def get name
36      self.get_value(@cpos+name)
37    end
38
39  end
40
41  class Cs < Neo::Cs
42
43  end
44end
45
46
47