Class: Surrogate::Value::BlockValue
- Defined in:
- lib/surrogate/values.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ BlockValue
constructor
A new instance of BlockValue.
- #value(method_name) ⇒ Object
Methods inherited from BaseValue
Constructor Details
#initialize(&block) ⇒ BlockValue
Returns a new instance of BlockValue.
40 41 42 |
# File 'lib/surrogate/values.rb', line 40 def initialize(&block) @block = block end |
Instance Method Details
#value(method_name) ⇒ Object
44 45 46 |
# File 'lib/surrogate/values.rb', line 44 def value(method_name) @block.call end |