Class: Locomotive::RelationalAlgebra::ProjectList

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

Instance Method Summary collapse

Methods included from XML

included, #quote

Constructor Details

#initialize(hash) ⇒ ProjectList

Returns a new instance of ProjectList.



19
20
21
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 19

def initialize(hash)
  self.project_list = hash
end

Instance Method Details

#cloneObject



41
42
43
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 41

def clone
  ProjectList.new( project_list.clone )
end

#new_itemsObject



27
28
29
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 27

def new_items
  project_list.values.flatten
end

#old_itemsObject



23
24
25
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 23

def old_items
  project_list.keys
end

#to_xmlObject



31
32
33
34
35
36
37
38
39
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 31

def to_xml
  project_list.collect do |old,news|
    news.collect do |new|
      column :name => new.to_xml,
             :old_name => old.to_xml,
             :new => new != old
    end.join
  end.join
end