Class: Code::Node::Splat
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::Splat
- Defined in:
- lib/code/node/splat.rb
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(parsed) ⇒ Splat
constructor
A new instance of Splat.
Methods inherited from Code::Node
Constructor Details
#initialize(parsed) ⇒ Splat
Returns a new instance of Splat.
6 7 8 9 10 11 |
# File 'lib/code/node/splat.rb', line 6 def initialize(parsed) return if parsed.blank? @operator = parsed.delete(:operator).presence @right = Node::Statement.new(parsed.delete(:right).presence) end |
Instance Method Details
#evaluate(**args) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/code/node/splat.rb', line 13 def evaluate(**args) if @right @right.evaluate(**args).call(operator: @operator, **args) else Object::Nothing.new end end |