Class: Code::Node::Operation::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/code/node/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation) ⇒ Operation

Returns a new instance of Operation.



7
8
9
10
# File 'lib/code/node/operation.rb', line 7

def initialize(operation)
  @operator = operation.fetch(:operator).to_s
  @statement = ::Code::Node::Statement.new(operation.fetch(:statement))
end

Instance Attribute Details

#operatorObject (readonly)

Returns the value of attribute operator.



5
6
7
# File 'lib/code/node/operation.rb', line 5

def operator
  @operator
end

#statementObject (readonly)

Returns the value of attribute statement.



5
6
7
# File 'lib/code/node/operation.rb', line 5

def statement
  @statement
end