Class: BuildTool::Cfg::Node
- Inherits:
-
MJ::Visitable
- Object
- MJ::Visitable
- BuildTool::Cfg::Node
- Defined in:
- lib/build-tool/cfg/node.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#options ⇒ Object
Returns the value of attribute options.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(values = nil, *args) ⇒ Node
constructor
A new instance of Node.
- #value ⇒ Object
Methods inherited from MJ::Visitable
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
#args ⇒ Object
Returns the value of attribute args.
13 14 15 |
# File 'lib/build-tool/cfg/node.rb', line 13 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/build-tool/cfg/node.rb', line 14 def @options end |
#values ⇒ Object
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
#value ⇒ Object
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 |