Class: Namarara::NotOp

Inherits:
Object
  • Object
show all
Defined in:
lib/namarara/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ NotOp

Returns a new instance of NotOp.



145
146
147
148
149
# File 'lib/namarara/parser.rb', line 145

def initialize(expr)
  @errors = []
  @errors.concat expr.errors
  @expr = expr
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



143
144
145
# File 'lib/namarara/parser.rb', line 143

def errors
  @errors
end

Instance Method Details

#computeObject



151
152
153
# File 'lib/namarara/parser.rb', line 151

def compute
  !@expr.compute
end

#to_sObject



155
156
157
# File 'lib/namarara/parser.rb', line 155

def to_s
  "NOT ( #{@expr} )"
end