Class: Ynl::Models::Thunk

Inherits:
Object
  • Object
show all
Defined in:
lib/ynl/models.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Thunk

Returns a new instance of Thunk.



19
20
21
# File 'lib/ynl/models.rb', line 19

def initialize(&block)
  @block = block
end

Instance Method Details

#resolve(f) ⇒ Object

Raises:



23
24
25
26
27
# File 'lib/ynl/models.rb', line 23

def resolve(f)
  raise ParseError, "Circular dependency" if @resolving
  @resolving = true
  @block.call(f)
end