Class: VORuby::ADQL::Unit

Inherits:
Object show all
Defined in:
lib/voruby/adql/parser.rb,
lib/voruby/adql/transforms.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit) ⇒ Unit

Returns a new instance of Unit.



44
45
46
# File 'lib/voruby/adql/parser.rb', line 44

def initialize(unit)
  self.unit = unit
end

Instance Attribute Details

#unitObject

Returns the value of attribute unit.



42
43
44
# File 'lib/voruby/adql/parser.rb', line 42

def unit
  @unit
end

Class Method Details

.from_xml(node) ⇒ Object



48
49
50
# File 'lib/voruby/adql/parser.rb', line 48

def self.from_xml(node)
  return Unit.new(node.text)
end

Instance Method Details

#to_adqlsObject



567
568
569
# File 'lib/voruby/adql/transforms.rb', line 567

def to_adqls
  self.unit
end

#to_sObject



52
53
54
# File 'lib/voruby/adql/parser.rb', line 52

def to_s
  "{unit=#{self.unit}}"
end