Class: Code::Node::LeftOperation::Operator
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::LeftOperation::Operator
- Defined in:
- lib/code/node/left_operation.rb
Constant Summary collapse
- DOT =
"."
- COLON_COLON =
"::"
- AMPERSAND_DOT =
"&."
- OR_KEYWORD =
"or"
- PIPE_PIPE =
"||"
- AND_KEYWORD =
"and"
- AMPERSAND_AMPERSAND =
"&&"
Instance Attribute Summary collapse
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Instance Method Summary collapse
- #and? ⇒ Boolean
- #call? ⇒ Boolean
-
#initialize(parsed) ⇒ Operator
constructor
A new instance of Operator.
- #or? ⇒ Boolean
- #safe_call? ⇒ Boolean
Methods inherited from Code::Node
Constructor Details
Instance Attribute Details
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
15 16 17 |
# File 'lib/code/node/left_operation.rb', line 15 def operator @operator end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
15 16 17 |
# File 'lib/code/node/left_operation.rb', line 15 def statement @statement end |
Instance Method Details
#and? ⇒ Boolean
36 37 38 |
# File 'lib/code/node/left_operation.rb', line 36 def and? operator == AND_KEYWORD || operator == AMPERSAND_AMPERSAND end |
#call? ⇒ Boolean
24 25 26 |
# File 'lib/code/node/left_operation.rb', line 24 def call? operator == DOT || operator == COLON_COLON end |
#or? ⇒ Boolean
32 33 34 |
# File 'lib/code/node/left_operation.rb', line 32 def or? operator == OR_KEYWORD || operator == PIPE_PIPE end |
#safe_call? ⇒ Boolean
28 29 30 |
# File 'lib/code/node/left_operation.rb', line 28 def safe_call? operator == AMPERSAND_DOT end |