Class: Namarara::OrOp
- Inherits:
-
Object
- Object
- Namarara::OrOp
- Defined in:
- lib/namarara/parser.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #compute ⇒ Object
-
#initialize(lval, rval) ⇒ OrOp
constructor
A new instance of OrOp.
- #to_s ⇒ Object
Constructor Details
#initialize(lval, rval) ⇒ OrOp
Returns a new instance of OrOp.
123 124 125 126 127 128 129 |
# File 'lib/namarara/parser.rb', line 123 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.
121 122 123 |
# File 'lib/namarara/parser.rb', line 121 def errors @errors end |
Instance Method Details
#compute ⇒ Object
131 132 133 134 135 |
# File 'lib/namarara/parser.rb', line 131 def compute # rubocop:disable Style/DoubleNegation !!@lval.compute || !!@rval.compute # rubocop:enable Style/DoubleNegation end |
#to_s ⇒ Object
137 138 139 |
# File 'lib/namarara/parser.rb', line 137 def to_s "( #{@lval} ) OR ( #{@rval} )" end |