Class: CloudBuilder::Reference::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_builder/reference.rb

Instance Method Summary collapse

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_dataObject



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