Class: Crisp::Nodes::Block
- Defined in:
- lib/crisp/nodes/block.rb
Overview
The block node
Instance Method Summary collapse
-
#eval(env) ⇒ Object
eval each element of the block and return the last result.
-
#resolve(env) ⇒ Object
a block resolves to itself.
Methods inherited from Base
Instance Method Details
#eval(env) ⇒ Object
eval each element of the block and return the last result
6 7 8 9 10 |
# File 'lib/crisp/nodes/block.rb', line 6 def eval(env) elements.map do |op| op.resolve_and_eval(env) end.last end |
#resolve(env) ⇒ Object
a block resolves to itself
13 14 15 |
# File 'lib/crisp/nodes/block.rb', line 13 def resolve(env) self end |