Class: Grape::Util::Lazy::Block

Inherits:
Base
  • Object
show all
Defined in:
lib/grape/util/lazy/block.rb

Instance Method Summary collapse

Methods inherited from Base

#to_s

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

#evaluateObject



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