Class: NxBuild::SlnNode

Inherits:
SlnProperty show all
Defined in:
lib/nxbuild/sln/node.rb

Instance Attribute Summary collapse

Attributes inherited from SlnProperty

#key, #values

Instance Method Summary collapse

Constructor Details

#initialize(tag) ⇒ SlnNode

Returns a new instance of SlnNode.



8
9
10
11
12
# File 'lib/nxbuild/sln/node.rb', line 8

def initialize(tag)
  super()
  @tag = tag
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



6
7
8
# File 'lib/nxbuild/sln/node.rb', line 6

def children
  @children
end

#tagObject

Returns the value of attribute tag.



5
6
7
# File 'lib/nxbuild/sln/node.rb', line 5

def tag
  @tag
end

Instance Method Details

#dump(buffer, indent = 0) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/nxbuild/sln/node.rb', line 14

def dump(buffer, indent = 0)
  buffer << "\t" * indent
  tagline = tag
  unless @key.nil?
    tagline += '(' + @key + ')'
  end
  unless @values.nil?
    tagline += ' = ' + @values.join(', ')
  end
  buffer << "#{tagline}\n"
  @children.each do |c|
    c.dump(buffer, indent + 1)
  end
  buffer << "\t" * indent
  buffer << "End#{@tag}\n"
end