Class: CodeMiner::BinaryExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::BinaryExpression
- Defined in:
- lib/codeminer/expressions/binary_expression.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
(also: #receiver)
readonly
Returns the value of attribute left.
-
#right ⇒ Object
(also: #body)
readonly
Returns the value of attribute right.
Attributes inherited from Expression
#args, #block, #delimiter, #src, #token
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(token, left, right, src) ⇒ BinaryExpression
constructor
A new instance of BinaryExpression.
- #type ⇒ Object
- #value ⇒ Object
Methods inherited from Expression
Methods included from SourceExtract::Usage
#adjust_src, #column, #column=, #end_column, #end_column=, #end_line, #end_line=, #line, #line=, #src, #src_extract
Constructor Details
#initialize(token, left, right, src) ⇒ BinaryExpression
Returns a new instance of BinaryExpression.
7 8 9 10 11 12 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 7 def initialize(token, left, right, src) @token = token @left = left @right = right @src = src end |
Instance Attribute Details
#left ⇒ Object (readonly) Also known as: receiver
Returns the value of attribute left.
5 6 7 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 5 def left @left end |
#right ⇒ Object (readonly) Also known as: body
Returns the value of attribute right.
5 6 7 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 5 def right @right end |
Instance Method Details
#each ⇒ Object
14 15 16 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 14 def each [left, right] end |
#type ⇒ Object
18 19 20 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 18 def type :binary end |
#value ⇒ Object
22 23 24 |
# File 'lib/codeminer/expressions/binary_expression.rb', line 22 def value @token.value end |