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. 
Constructor Details
#initialize(parsed) ⇒ UnaryMinus
Returns a new instance of UnaryMinus.
| 4 5 6 7 8 | # File 'lib/code/node/unary_minus.rb', line 4 def initialize(parsed) @operator = parsed.delete(:operator) @right = Node::Statement.new(parsed.delete(:right)) super(parsed) end | 
Instance Method Details
#evaluate(**args) ⇒ Object
| 10 11 12 | # File 'lib/code/node/unary_minus.rb', line 10 def evaluate(**args) @right.evaluate(**args).call(operator: @operator, arguments: [], **args) end |