Class: Namarara::AndOp
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #compute ⇒ Object
-
#initialize(lval, rval) ⇒ AndOp
constructor
A new instance of AndOp.
- #to_s ⇒ Object
Constructor Details
#initialize(lval, rval) ⇒ AndOp
Returns a new instance of AndOp.
101 102 103 104 105 106 107 |
# File 'lib/namarara/parser.rb', line 101 def initialize(lval, rval) @errors = [] @errors.concat lval.errors @errors.concat rval.errors @lval = lval @rval = rval end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
99 100 101 |
# File 'lib/namarara/parser.rb', line 99 def errors @errors end |
Instance Method Details
#compute ⇒ Object
109 110 111 112 113 |
# File 'lib/namarara/parser.rb', line 109 def compute # rubocop:disable Style/DoubleNegation !!@lval.compute && !!@rval.compute # rubocop:enable Style/DoubleNegation end |
#to_s ⇒ Object
115 116 117 |
# File 'lib/namarara/parser.rb', line 115 def to_s "( #{@lval} ) AND ( #{@rval} )" end |