Class: Code::Node::Block
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::Block
- Defined in:
- lib/code/node/block.rb
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(block) ⇒ Block
constructor
A new instance of Block.
Constructor Details
#initialize(block) ⇒ Block
Returns a new instance of Block.
4 5 6 7 8 9 10 |
# File 'lib/code/node/block.rb', line 4 def initialize(block) @body = ::Code::Node::Code.new(block.fetch(:body)) @arguments = block.fetch(:arguments, []) @arguments.map! do |argument| ::Code::Node::FunctionArgument.new(argument) end end |