Class: Locomotive::RelationalAlgebra::ProjectList
- Inherits:
-
Object
- Object
- Locomotive::RelationalAlgebra::ProjectList
- Includes:
- XML
- Defined in:
- lib/locomotive/relational_algebra/operators/projections/projection.rb
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(hash) ⇒ ProjectList
constructor
A new instance of ProjectList.
- #new_items ⇒ Object
- #old_items ⇒ Object
- #to_xml ⇒ Object
Methods included from XML
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
#clone ⇒ Object
41 42 43 |
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 41 def clone ProjectList.new( project_list.clone ) end |
#new_items ⇒ Object
27 28 29 |
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 27 def new_items project_list.values.flatten end |
#old_items ⇒ Object
23 24 25 |
# File 'lib/locomotive/relational_algebra/operators/projections/projection.rb', line 23 def old_items project_list.keys end |
#to_xml ⇒ Object
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 |