Class: Code::Node::NotKeyword
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::NotKeyword
- Defined in:
- lib/code/node/not_keyword.rb
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(not_keyword) ⇒ NotKeyword
constructor
A new instance of NotKeyword.
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 |