Class: Ynl::Models::Thunk
- Inherits:
-
Object
- Object
- Ynl::Models::Thunk
- Defined in:
- lib/ynl/models.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Thunk
constructor
A new instance of Thunk.
- #resolve(f) ⇒ Object
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
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 |