Class: Grape::Util::Lazy::Block
- Defined in:
- lib/grape/util/lazy/block.rb
Instance Method Summary collapse
- #evaluate ⇒ Object
- #evaluate_from(configuration) ⇒ Object
-
#initialize(&new_block) ⇒ Block
constructor
A new instance of Block.
Methods inherited from Base
Constructor Details
#initialize(&new_block) ⇒ Block
Returns a new instance of Block.
7 8 9 10 |
# File 'lib/grape/util/lazy/block.rb', line 7 def initialize(&new_block) super() @block = new_block end |
Instance Method Details
#evaluate ⇒ Object
16 17 18 |
# File 'lib/grape/util/lazy/block.rb', line 16 def evaluate @block.call({}) end |
#evaluate_from(configuration) ⇒ Object
12 13 14 |
# File 'lib/grape/util/lazy/block.rb', line 12 def evaluate_from(configuration) @block.call(configuration) end |