Class: Aws::Templates::Utils::Default::Definition::Calculable

Inherits:
Aws::Templates::Utils::Default::Definition show all
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

Instance Method Summary collapse

Methods included from Guarded

#guarded_for

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

#blockObject (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