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