Class: CloudBuilder::Reference::Key
- Inherits:
-
Object
- Object
- CloudBuilder::Reference::Key
- Defined in:
- lib/cloud_builder/reference.rb
Instance Method Summary collapse
- #[](subkey) ⇒ Object
-
#initialize(name, key) ⇒ Key
constructor
A new instance of Key.
- #to_json_data ⇒ Object
Constructor Details
#initialize(name, key) ⇒ Key
Returns a new instance of Key.
72 73 74 75 |
# File 'lib/cloud_builder/reference.rb', line 72 def initialize(name, key) @map_name = name @key = key end |
Instance Method Details
#[](subkey) ⇒ Object
77 78 79 |
# File 'lib/cloud_builder/reference.rb', line 77 def [](subkey) Key.new(@map_name, @key + [subkey]) end |
#to_json_data ⇒ Object
81 82 83 |
# File 'lib/cloud_builder/reference.rb', line 81 def to_json_data {FIND_IN_MAP => [DSL.format(@map_name)] + DSL.jsonize(@key)} end |