Class: WAB::Impl::Not

Inherits:
Expr
  • Object
show all
Defined in:
lib/wab/impl/exprs/not.rb

Overview

Negates and expression.

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ Not

Create an NOT expression with the provided argument which must be an instance of a subclass of the Expr class.

arg

argument to the NOT expression



12
13
14
15
# File 'lib/wab/impl/exprs/not.rb', line 12

def initialize(arg)
  super()
  @arg = arg
end

Instance Method Details

#eval(data) ⇒ Object



17
18
19
# File 'lib/wab/impl/exprs/not.rb', line 17

def eval(data)
  !@arg.eval(data)
end

#nativeObject



21
22
23
# File 'lib/wab/impl/exprs/not.rb', line 21

def native()
  ['NOT', @arg.native]
end