Class: Surrogate::Value::BlockValue

Inherits:
BaseValue
  • Object
show all
Defined in:
lib/surrogate/values.rb

Instance Method Summary collapse

Methods inherited from BaseValue

#factory

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