Class: Code::Node::NotKeyword

Inherits:
Code::Node show all
Defined in:
lib/code/node/not_keyword.rb

Instance Method Summary collapse

Constructor Details

#initialize(not_keyword) ⇒ NotKeyword

Returns a new instance of NotKeyword.



4
5
6
# File 'lib/code/node/not_keyword.rb', line 4

def initialize(not_keyword)
  @statement = ::Code::Node::Statement.new(not_keyword)
end

Instance Method Details

#evaluate(**args) ⇒ Object



8
9
10
# File 'lib/code/node/not_keyword.rb', line 8

def evaluate(**args)
  ::Code::Object::Boolean.new(!@statement.evaluate(**args).truthy?)
end