Class: ManaMana::TDSL::AssignmentNode

Inherits:
Node
  • Object
show all
Defined in:
lib/manamana/tdsl/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #name

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



36
37
38
# File 'lib/manamana/tdsl/nodes.rb', line 36

def key
  @key
end

#valueObject (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