Class: Locomotive::RelationalAlgebra::RefTbl
- Inherits:
-
Leaf
- Object
- RelAlgAstNode
- Operator
- Leaf
- Locomotive::RelationalAlgebra::RefTbl
- Defined in:
- lib/locomotive/relational_algebra/operators/tables/ref_table.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#name ⇒ Object
Returns the value of attribute name.
-
#name_mapping ⇒ Object
readonly
Returns the value of attribute name_mapping.
Attributes inherited from Operator
Attributes included from AstHelpers::AstNode
#kind, #left_child, #owner, #right_child, #value
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(name, attributes, keys) ⇒ RefTbl
constructor
A new instance of RefTbl.
- #xml_content ⇒ Object
- #xml_kind ⇒ Object
Methods inherited from Leaf
Methods inherited from Operator
#bound, #free, #to_xml, #xml_schema
Methods included from XML
Methods included from AstHelpers::Annotations
Methods included from AstHelpers::AstNode
#has_left_child?, #has_right_child?, #is_leaf?, #traverse, #traverse_strategy=
Constructor Details
#initialize(name, attributes, keys) ⇒ RefTbl
Returns a new instance of RefTbl.
38 39 40 41 42 43 44 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 38 def initialize(name, attributes, keys) @name = name @attributes = attributes @keys = keys @name_mapping = get_name_mapping self.schema = get_schema end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Locomotive::AstHelpers::Annotations
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 7 def attributes @attributes end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
7 8 9 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 7 def keys @keys end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 7 def name @name end |
#name_mapping ⇒ Object (readonly)
Returns the value of attribute name_mapping.
36 37 38 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 36 def name_mapping @name_mapping end |
Instance Method Details
#clone ⇒ Object
68 69 70 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 68 def clone RefTbl.new(name.clone, attributes.clone, keys.clone) end |
#xml_content ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 50 def xml_content [properties do _keys_ do pos = -1 keys.map do |k| key :name => k.to_xml, :position => pos += 1 end.join end end, content do table :name => name do name_mapping.collect do |new,old| column :name => new.to_xml, :tname => old.to_xml, :type => schema[new].first.to_xml end.join end end].join end |
#xml_kind ⇒ Object
46 47 48 |
# File 'lib/locomotive/relational_algebra/operators/tables/ref_table.rb', line 46 def xml_kind :ref_tbl end |