Class: Interscript::DSL::Items::Map
- Inherits:
-
Object
- Object
- Interscript::DSL::Items::Map
- Defined in:
- lib/interscript/dsl/items.rb
Overview
Implementation of ‘map.x.aliasname` and `map.x.stage.stagename`
Instance Method Summary collapse
-
#[](alias_name) ⇒ Object
(also: #method_missing)
Implementation of ‘map.x.aliasname`.
-
#initialize(name) ⇒ Map
constructor
A new instance of Map.
-
#stage ⇒ Object
Implementation of ‘map.x.stage.stagename`.
Constructor Details
#initialize(name) ⇒ Map
Returns a new instance of Map.
67 |
# File 'lib/interscript/dsl/items.rb', line 67 def initialize name; @name = name; end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
Implementation of ‘map.x.aliasname`
74 75 76 77 |
# File 'lib/interscript/dsl/items.rb', line 74 def [] alias_name Symbol === alias_name or raise Interscript::MapLogicError, "An alias name must be a Symbol, not #{alias_name.class}" Interscript::Node::Item::Alias.new(alias_name, map: @name) end |
Instance Method Details
#[](alias_name) ⇒ Object Also known as: method_missing
Implementation of ‘map.x.aliasname`
70 71 72 73 |
# File 'lib/interscript/dsl/items.rb', line 70 def [] alias_name Symbol === alias_name or raise Interscript::MapLogicError, "An alias name must be a Symbol, not #{alias_name.class}" Interscript::Node::Item::Alias.new(alias_name, map: @name) end |