Class: Aws::Templates::Utils::Default::Definition::Calculable
- Inherits:
-
Aws::Templates::Utils::Default::Definition
- Object
- Aws::Templates::Utils::Default::Definition
- Aws::Templates::Utils::Default::Definition::Calculable
- Includes:
- Guarded
- Defined in:
- lib/aws/templates/utils/default.rb
Overview
Lazy-calculated definition
Contains functor object which will be evaluated only during actual value look-up
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #for(instance) ⇒ Object
-
#initialize(block) ⇒ Calculable
constructor
A new instance of Calculable.
Methods included from Guarded
Methods inherited from Aws::Templates::Utils::Default::Definition
empty, from, #merge, #override?, #to_definition
Constructor Details
#initialize(block) ⇒ Calculable
Returns a new instance of Calculable.
134 135 136 |
# File 'lib/aws/templates/utils/default.rb', line 134 def initialize(block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
132 133 134 |
# File 'lib/aws/templates/utils/default.rb', line 132 def block @block end |
Instance Method Details
#for(instance) ⇒ Object
138 139 140 |
# File 'lib/aws/templates/utils/default.rb', line 138 def for(instance) guarded_for(instance, block) { _process_value(block, instance) } end |