Class: Locomotive::RelationalAlgebra::LiteralList

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

Instance Method Summary collapse

Methods included from XML

included, #quote

Constructor Details

#initialize(hash) ⇒ LiteralList

Returns a new instance of LiteralList.



21
22
23
# File 'lib/locomotive/relational_algebra/operators/tables/literal_table.rb', line 21

def initialize(hash)
  self.literal_list = hash
end

Instance Method Details

#attributesObject



25
26
27
# File 'lib/locomotive/relational_algebra/operators/tables/literal_table.rb', line 25

def attributes
  literal_list.keys
end

#cloneObject



39
40
41
# File 'lib/locomotive/relational_algebra/operators/tables/literal_table.rb', line 39

def clone
  LiteralList.new( literal_list.clone )
end

#to_xmlObject



29
30
31
32
33
34
35
36
37
# File 'lib/locomotive/relational_algebra/operators/tables/literal_table.rb', line 29

def to_xml
  literal_list.collect do |attr,atomary|
    column :name => attr.to_xml, :new => true do 
      atomary.collect do |atom|
        atom.to_xml
      end.join
    end
  end.join
end