Class: Locomotive::RelationalAlgebra::SideEffects

Inherits:
Object
  • Object
show all
Defined in:
lib/locomotive/relational_algebra/query_information.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(side) ⇒ SideEffects

Returns a new instance of SideEffects.



407
408
409
# File 'lib/locomotive/relational_algebra/query_information.rb', line 407

def initialize(side)
  @side = to_side_effect side
end

Instance Attribute Details

#sideObject (readonly)

Returns the value of attribute side.



405
406
407
# File 'lib/locomotive/relational_algebra/query_information.rb', line 405

def side
  @side
end

Instance Method Details

#add(side_effect) ⇒ Object Also known as: +



411
412
413
414
# File 'lib/locomotive/relational_algebra/query_information.rb', line 411

def add(side_effect)
  SideEffects.new(
    @side + to_side_effect(side_effect))
end

#planObject



418
419
420
421
422
# File 'lib/locomotive/relational_algebra/query_information.rb', line 418

def plan
  @side.reduce(Nil.new) do |s1, s2|
    s1.error(s2, Item.new(1))
  end
end