Class: CloudBuilder::Mappings
- Inherits:
-
Object
- Object
- CloudBuilder::Mappings
- Extended by:
- Forwardable
- Defined in:
- lib/cloud_builder/mappings.rb
Instance Method Summary collapse
-
#initialize ⇒ Mappings
constructor
A new instance of Mappings.
- #method_missing(map_name, values) ⇒ Object
- #to_json_data ⇒ Object
Constructor Details
#initialize ⇒ Mappings
Returns a new instance of Mappings.
8 9 10 |
# File 'lib/cloud_builder/mappings.rb', line 8 def initialize @maps = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(map_name, values) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/cloud_builder/mappings.rb', line 20 def method_missing(map_name, values) if @maps.has_key?(map_name.to_s) raise NameError('mapping %s is already defined' % map_name.to_s) end @maps[map_name.to_s] = values end |