Class: Jets::Cfn::Resource::Associated
- Inherits:
-
Object
- Object
- Jets::Cfn::Resource::Associated
- Extended by:
- Memoist
- Defined in:
- lib/jets/cfn/resource/associated.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#multiple_resources ⇒ Object
Returns the value of attribute multiple_resources.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(*definition) ⇒ Associated
constructor
A new instance of Associated.
- #logical_id ⇒ Object
- #standardized ⇒ Object
Constructor Details
#initialize(*definition) ⇒ Associated
Returns a new instance of Associated.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jets/cfn/resource/associated.rb', line 9 def initialize(*definition) @definition = definition.flatten # Some associated resources require multiple resources for a single Lambda function. For # example `sqs_event` can create a `SQS::Queue` and `Lambda::EventSourceMapping`. We set # a `multiple` flag so `add_logical_id_counter` can use it to avoid adding counter ids to # these type of resources. The `multiple` flag allows us to handle both: # # 1. Associated resources that contain multiple resources for a single Lambda function # 2. A single Lambda function with multiple events. In this case, a counter is added # # Setting `multiple` to true means the counter id will not be added. @multiple_resources = false end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
7 8 9 |
# File 'lib/jets/cfn/resource/associated.rb', line 7 def definition @definition end |
#multiple_resources ⇒ Object
Returns the value of attribute multiple_resources.
8 9 10 |
# File 'lib/jets/cfn/resource/associated.rb', line 8 def multiple_resources @multiple_resources end |
Instance Method Details
#attributes ⇒ Object
27 28 29 |
# File 'lib/jets/cfn/resource/associated.rb', line 27 def attributes standardized.values.first end |
#logical_id ⇒ Object
23 24 25 |
# File 'lib/jets/cfn/resource/associated.rb', line 23 def logical_id standardized.keys.first end |
#standardized ⇒ Object
31 32 33 34 |
# File 'lib/jets/cfn/resource/associated.rb', line 31 def standardized standardizer = Standardizer.new(definition) standardizer.standarize(definition) # doesnt camelize keys yet end |