Class: Copper::VariableIdentifier

Inherits:
CopperNode
  • Object
show all
Defined in:
lib/copper/variable_identifier.rb

Instance Method Summary collapse

Instance Method Details

#value(vars = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/copper/variable_identifier.rb', line 4

def value(vars = {})
	variables = vars[:variables] || {}
	identifier = self.text_value.to_sym
	if variables.has_key?(identifier)
		return variables[identifier]
	else
		raise ::Copper::ParseError, "no variable found with name #{identifier}"
	end
end