Class: BuildTool::Cfg::Node

Inherits:
MJ::Visitable show all
Defined in:
lib/build-tool/cfg/node.rb

Direct Known Subclasses

NodeList

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MJ::Visitable

#accept

Constructor Details

#initialize(values = nil, *args) ⇒ Node

Returns a new instance of Node.



21
22
23
24
25
26
27
28
29
# File 'lib/build-tool/cfg/node.rb', line 21

def initialize(values = nil, *args )
    @values = values
    @args = *args
    if !@args.empty? && @args[-1].kind_of?( Hash )
        @options = @args.pop
    else
        @options = {}
    end
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



13
14
15
# File 'lib/build-tool/cfg/node.rb', line 13

def args
  @args
end

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/build-tool/cfg/node.rb', line 14

def options
  @options
end

#valuesObject

Returns the value of attribute values.



12
13
14
# File 'lib/build-tool/cfg/node.rb', line 12

def values
  @values
end

Instance Method Details

#valueObject



16
17
18
19
# File 'lib/build-tool/cfg/node.rb', line 16

def value
    values
    #raise StandardError, "1 Value expected.#{values.length} values found!."
end