Class: Locomotive::RelationalAlgebra::RType

Inherits:
Object
  • Object
show all
Includes:
XML, Singleton
Defined in:
lib/locomotive/relational_algebra/types.rb

Direct Known Subclasses

RBool, RDbl, RStr

Instance Method Summary collapse

Methods included from XML

included, #quote

Constructor Details

#initializeRType

Returns a new instance of RType.



13
14
15
16
17
18
# File 'lib/locomotive/relational_algebra/types.rb', line 13

def initialize()
  if self.class == RType
    raise AbstractClassError,
          "#{self.class} is an abstract class" 
  end
end

Instance Method Details

#cloneObject



20
21
22
23
24
# File 'lib/locomotive/relational_algebra/types.rb', line 20

def clone
  # since all types are singletons
  # we can return the object itself
  self
end

#inspectObject



30
31
32
# File 'lib/locomotive/relational_algebra/types.rb', line 30

def inspect
  "<#{self.class.to_s.split('::').last}>"
end

#to_xmlObject



26
27
28
# File 'lib/locomotive/relational_algebra/types.rb', line 26

def to_xml
  self.class.to_s.split("::").last.downcase[1..-1]
end