Class: CloudFormer::List
- Inherits:
-
Object
- Object
- CloudFormer::List
- Defined in:
- lib/cloud_former/resources/list.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
- #entry(*args, &block) ⇒ Object
-
#initialize(resource_options, &block) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(resource_options, &block) ⇒ List
Returns a new instance of List.
3 4 5 6 7 8 9 10 11 |
# File 'lib/cloud_former/resources/list.rb', line 3 def initialize(, &block) @resource_options = @entries = [] if block.arity == 0 instance_eval(&block) else block.call(self) end end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
23 24 25 |
# File 'lib/cloud_former/resources/list.rb', line 23 def entries @entries end |
Instance Method Details
#entry(*args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/cloud_former/resources/list.rb', line 13 def entry(*args, &block) @entries << @resource_options[:type].new(*args) do if block.arity == 0 instance_eval(&block) else block.call(self) end end end |