Class: ManaMana::TDSL::AssignmentNode
- Defined in:
- lib/manamana/tdsl/nodes.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #gsub!(string) ⇒ Object
-
#initialize(name = '', children = []) ⇒ AssignmentNode
constructor
A new instance of AssignmentNode.
Methods inherited from Node
Constructor Details
#initialize(name = '', children = []) ⇒ AssignmentNode
Returns a new instance of AssignmentNode.
38 39 40 |
# File 'lib/manamana/tdsl/nodes.rb', line 38 def initialize(name = '', children = []) @key, @value = name.split('=').map{ |n| n.strip } end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
36 37 38 |
# File 'lib/manamana/tdsl/nodes.rb', line 36 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
36 37 38 |
# File 'lib/manamana/tdsl/nodes.rb', line 36 def value @value end |
Instance Method Details
#gsub!(string) ⇒ Object
42 43 44 |
# File 'lib/manamana/tdsl/nodes.rb', line 42 def gsub!(string) string.gsub! /\<#{ key }\>/, "\" + " + value + " + \"" end |