Class: Chemtrail::Mapping
- Inherits:
-
Object
- Object
- Chemtrail::Mapping
- Defined in:
- lib/chemtrail/mapping.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #entries ⇒ Object
- #find(top_level, second_level) ⇒ Object
-
#initialize(id) ⇒ Mapping
constructor
A new instance of Mapping.
- #to_hash ⇒ Object
Constructor Details
#initialize(id) ⇒ Mapping
Returns a new instance of Mapping.
6 7 8 |
# File 'lib/chemtrail/mapping.rb', line 6 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/chemtrail/mapping.rb', line 4 def id @id end |
Instance Method Details
#entries ⇒ Object
10 11 12 |
# File 'lib/chemtrail/mapping.rb', line 10 def entries @entries ||= {} end |
#find(top_level, second_level) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/chemtrail/mapping.rb', line 14 def find(top_level, second_level) { "Fn::FindInMap" => [ id, Chemtrail::ReferencePresenter.new(top_level).to_parameter, Chemtrail::ReferencePresenter.new(second_level).to_parameter ] } end |
#to_hash ⇒ Object
24 25 26 27 28 |
# File 'lib/chemtrail/mapping.rb', line 24 def to_hash { id => entries } end |