Class: CloudFormatter::Reference::Key

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

Instance Method Summary collapse

Constructor Details

#initialize(name, key) ⇒ Key

Returns a new instance of Key


22
23
24
25
# File 'lib/cloud_formatter/reference.rb', line 22

def initialize(name, key)
  @map_name = name
  @key      = key
end

Instance Method Details

#[](subkey) ⇒ Object


27
28
29
# File 'lib/cloud_formatter/reference.rb', line 27

def [](subkey)
  Key.new(@map_name, @key + [subkey])
end

#to_json_dataObject


31
32
33
# File 'lib/cloud_formatter/reference.rb', line 31

def to_json_data
  {FIND_IN_MAP => [DSL.format(@map_name)] + DSL.jsonize(@key)}
end