Class: Locomotive::RelationalAlgebra::RAtomic

Inherits:
Object
  • Object
show all
Extended by:
TypeChecking::Signature
Includes:
XML
Defined in:
lib/locomotive/relational_algebra/types.rb

Overview

An atomic value constists of a value an its associated type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TypeChecking::Signature

def_sig

Methods included from XML

included, #quote

Constructor Details

#initialize(val, ty) ⇒ RAtomic

Returns a new instance of RAtomic.



57
58
59
60
# File 'lib/locomotive/relational_algebra/types.rb', line 57

def initialize(val, ty)
  self.value,
  self.type = val, ty
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



53
54
55
# File 'lib/locomotive/relational_algebra/types.rb', line 53

def type
  @type
end

#valueObject

Returns the value of attribute value.



53
54
55
# File 'lib/locomotive/relational_algebra/types.rb', line 53

def value
  @value
end

Instance Method Details

#cloneObject



68
69
70
71
# File 'lib/locomotive/relational_algebra/types.rb', line 68

def clone
  RAtomic.new(self.value,
             self.type)
end

#to_xmlObject



62
63
64
65
66
# File 'lib/locomotive/relational_algebra/types.rb', line 62

def to_xml
  _value_ :type => type.to_xml do
    value
  end
end