Class: Namarara::EqOp

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lval, rval) ⇒ EqOp

Returns a new instance of EqOp.



163
164
165
166
167
168
169
# File 'lib/namarara/parser.rb', line 163

def initialize(lval, rval)
  @errors = []
  @errors.concat lval.errors
  @errors.concat rval.errors
  @lval = lval
  @rval = rval
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



161
162
163
# File 'lib/namarara/parser.rb', line 161

def errors
  @errors
end

Instance Method Details

#computeObject



171
172
173
# File 'lib/namarara/parser.rb', line 171

def compute
  @lval.value == @rval.value
end

#to_sObject



175
176
177
# File 'lib/namarara/parser.rb', line 175

def to_s
  "#{@lval} = #{@rval}"
end