Class: Aws::Templates::Utils::Parametrized::Getter::Value
- Inherits:
-
Aws::Templates::Utils::Parametrized::Getter
- Object
- Aws::Templates::Utils::Parametrized::Getter
- Aws::Templates::Utils::Parametrized::Getter::Value
- Defined in:
- lib/aws/templates/utils/parametrized/getters.rb
Overview
Calculate value
If a block is specified, it will be executed in the instance context and return will be used as parameter value. If a value specified then it will be used as parameter value instead.
Example
class Piece
include Aws::Templates::Utils::Parametrized
parameter :param1, :getter => value(1)
parameter :param2, :getter => value { [:z] + 1 }
end
i = Piece.new(:z => 3)
i.param2 # => 4
i.param1 # => 1
Instance Attribute Summary collapse
-
#calculation ⇒ Object
readonly
Returns the value of attribute calculation.
Instance Method Summary collapse
-
#initialize(calculation) ⇒ Value
constructor
A new instance of Value.
Methods inherited from Aws::Templates::Utils::Parametrized::Getter
Constructor Details
#initialize(calculation) ⇒ Value
144 145 146 |
# File 'lib/aws/templates/utils/parametrized/getters.rb', line 144 def initialize(calculation) @calculation = calculation end |
Instance Attribute Details
#calculation ⇒ Object (readonly)
Returns the value of attribute calculation.
142 143 144 |
# File 'lib/aws/templates/utils/parametrized/getters.rb', line 142 def calculation @calculation end |