Class: Locomotive::RelationalAlgebra::QueryPlan

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XML

included, #quote

Constructor Details

#initialize(plan, cols, id, result_type = nil, idref = nil, colref = nil) ⇒ QueryPlan

Returns a new instance of QueryPlan.



563
564
565
566
567
568
569
570
# File 'lib/locomotive/relational_algebra/query_information.rb', line 563

def initialize(plan, cols, id, result_type=nil, idref=nil, colref=nil)
  @id = id
  @idref = idref
  @colref = colref
  @result_type = result_type
  @plan = plan
  @cols = cols
end

Instance Attribute Details

#colrefObject (readonly)

Returns the value of attribute colref.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def colref
  @colref
end

#colsObject (readonly)

Returns the value of attribute cols.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def cols
  @cols
end

#idObject (readonly)

Returns the value of attribute id.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def id
  @id
end

#idrefObject (readonly)

Returns the value of attribute idref.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def idref
  @idref
end

#planObject (readonly)

Returns the value of attribute plan.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def plan
  @plan
end

#result_typeObject (readonly)

Returns the value of attribute result_type.



556
557
558
# File 'lib/locomotive/relational_algebra/query_information.rb', line 556

def result_type
  @result_type
end

Instance Method Details

#to_xmlObject



572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/locomotive/relational_algebra/query_information.rb', line 572

def to_xml
  attributes = { :id => id }
  attributes.merge!({ :idref => idref }) if idref
  attributes.merge!({ :colref => colref }) if colref

  query_plan(attributes) do
    p = []
    p << properties do
           property(:name => :overallResultType, :value => result_type.to_xml)
         end if result_type
    p << plan.serialize
    p.join
  end
end