Class: RMasm::BinaryExpression
- Inherits:
-
ExpressionElement
- Object
- ExpressionElement
- RMasm::BinaryExpression
- Defined in:
- lib/rmasm/expression.rb
Overview
Binary expression
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, right, operator) ⇒ BinaryExpression
constructor
A new instance of BinaryExpression.
- #to_s ⇒ Object
Methods included from ExpressionOperations
#*, #+, #-, #/, #check_arg, #coerce
Constructor Details
#initialize(left, right, operator) ⇒ BinaryExpression
Returns a new instance of BinaryExpression.
67 68 69 70 71 |
# File 'lib/rmasm/expression.rb', line 67 def initialize(left, right, operator) @left = left @right = right @operator = operator end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
65 66 67 |
# File 'lib/rmasm/expression.rb', line 65 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
65 66 67 |
# File 'lib/rmasm/expression.rb', line 65 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
65 66 67 |
# File 'lib/rmasm/expression.rb', line 65 def right @right end |
Instance Method Details
#to_s ⇒ Object
73 74 75 |
# File 'lib/rmasm/expression.rb', line 73 def to_s() "#{@left} #{@operator} #{@right}" end |