Class: Code::Node::LeftOperation::Operator

Inherits:
Code::Node
  • Object
show all
Defined in:
lib/code/node/left_operation.rb

Constant Summary collapse

DOT =
"."
COLON_COLON =
"::"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Code::Node

#evaluate, #resolve

Constructor Details

#initialize(parsed) ⇒ Operator

Returns a new instance of Operator.



12
13
14
15
# File 'lib/code/node/left_operation.rb', line 12

def initialize(parsed)
  @operator = parsed.delete(:operator)
  @statement = Statement.new(parsed.delete(:statement))
end

Instance Attribute Details

#operatorObject (readonly)

Returns the value of attribute operator.



10
11
12
# File 'lib/code/node/left_operation.rb', line 10

def operator
  @operator
end

#statementObject (readonly)

Returns the value of attribute statement.



10
11
12
# File 'lib/code/node/left_operation.rb', line 10

def statement
  @statement
end

Instance Method Details

#call?Boolean

Returns:



17
18
19
# File 'lib/code/node/left_operation.rb', line 17

def call?
  operator == DOT || operator == COLON_COLON
end