Class: Aurum::Parser::SemanticActionContext
- Inherits:
-
Object
- Object
- Aurum::Parser::SemanticActionContext
- Defined in:
- lib/aurum/engine.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ SemanticActionContext
constructor
A new instance of SemanticActionContext.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(hash) ⇒ SemanticActionContext
Returns a new instance of SemanticActionContext.
150 151 152 |
# File 'lib/aurum/engine.rb', line 150 def initialize hash @hash = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
154 155 156 157 158 159 |
# File 'lib/aurum/engine.rb', line 154 def method_missing name, *args name_string = name.to_s index = name_string =~ /\d+/ ? name_string.slice!(/\d+/).to_i : 0 @hash[name_string][-index] and return @hash[name_string][-index] SemanticAttributes.new end |