Class: Locomotive::RelationalAlgebra::Attribute
- Inherits:
-
GenericAttribute
- Object
- GenericAttribute
- Locomotive::RelationalAlgebra::Attribute
- Includes:
- HashKeys
- Defined in:
- lib/locomotive/relational_algebra/attributes.rb
Defined Under Namespace
Modules: HashKeys
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Equality for attributes is defined over their class their name.
- #clone ⇒ Object
-
#initialize(name) ⇒ Attribute
constructor
A new instance of Attribute.
- #inspect ⇒ Object
- #to_xml ⇒ Object
Methods included from HashKeys
Constructor Details
#initialize(name) ⇒ Attribute
Returns a new instance of Attribute.
121 122 123 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 121 def initialize(name) @name = name.to_s end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
119 120 121 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 119 def name @name end |
Instance Method Details
#==(other) ⇒ Object
Equality for attributes is defined over their class their name
127 128 129 130 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 127 def ==(other) self.class == other.class and self.name == other.name end |
#clone ⇒ Object
160 161 162 163 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 160 def clone # an attributes contains only an id Attribute.new(name) end |
#inspect ⇒ Object
156 157 158 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 156 def inspect "<#{self.class.to_s.split('::').last} name:#{name}>" end |
#to_xml ⇒ Object
150 151 152 153 |
# File 'lib/locomotive/relational_algebra/attributes.rb', line 150 def to_xml # Be careful of classes that are nested in modules name end |