Class: CloudBuilder::Parameter
- Defined in:
- lib/cloud_builder/parameter.rb
Instance Method Summary collapse
- #brick ⇒ Object
- #default(value) ⇒ Object
- #globals ⇒ Object
-
#initialize(stack, &block) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_hash ⇒ Object
- #to_json_data ⇒ Object
- #type(value) ⇒ Object
Methods inherited from JSONable
Constructor Details
#initialize(stack, &block) ⇒ Parameter
Returns a new instance of Parameter.
3 4 5 6 7 8 9 |
# File 'lib/cloud_builder/parameter.rb', line 3 def initialize(stack, &block) @stack = stack @Type = 'String' @block = block instance_exec(&block) end |
Instance Method Details
#brick ⇒ Object
33 34 35 |
# File 'lib/cloud_builder/parameter.rb', line 33 def brick @block.binding.eval('brick') end |
#default(value) ⇒ Object
25 26 27 |
# File 'lib/cloud_builder/parameter.rb', line 25 def default value @Default = value end |
#globals ⇒ Object
17 18 19 |
# File 'lib/cloud_builder/parameter.rb', line 17 def globals @stack.globals end |
#to_hash ⇒ Object
11 12 13 14 15 |
# File 'lib/cloud_builder/parameter.rb', line 11 def to_hash hash = super.to_hash hash.delete('block') hash end |
#to_json_data ⇒ Object
21 22 23 |
# File 'lib/cloud_builder/parameter.rb', line 21 def to_json_data { "Default" => @Default, "Type" => @Type } end |
#type(value) ⇒ Object
29 30 31 |
# File 'lib/cloud_builder/parameter.rb', line 29 def type value @Type = value end |