Class: VORuby::ADQL::V1_0::Function

Inherits:
ScalarExpression show all
Defined in:
lib/voruby/adql/1.0/adql.rb

Overview

The base type for a function

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(arg, allow = nil) ⇒ Function

Returns a new instance of Function.



470
471
472
473
474
# File 'lib/voruby/adql/1.0/adql.rb', line 470

def initialize(arg, allow=nil)
  super()
  self.arg = arg
  self.allow = allow
end

Instance Attribute Details

#allowObject

Returns the value of attribute allow.



468
469
470
# File 'lib/voruby/adql/1.0/adql.rb', line 468

def allow
  @allow
end

#argObject

Returns the value of attribute arg.



468
469
470
# File 'lib/voruby/adql/1.0/adql.rb', line 468

def arg
  @arg
end

#nameObject (readonly)

Returns the value of attribute name.



468
469
470
# File 'lib/voruby/adql/1.0/adql.rb', line 468

def name
  @name
end

Instance Method Details

#==(f) ⇒ Object



487
488
489
490
491
# File 'lib/voruby/adql/1.0/adql.rb', line 487

def ==(f)
  self.name == f.name and
  self.arg == f.arg and
  self.allow == f.allow
end

#to_sObject



504
505
506
507
508
# File 'lib/voruby/adql/1.0/adql.rb', line 504

def to_s
  f = "#{self.name}(#{self.arg})"
  f = "#{self.allow} #{f}" if self.allow
  f
end

#to_xml(name = nil) ⇒ Object



493
494
495
496
497
498
499
500
501
502
# File 'lib/voruby/adql/1.0/adql.rb', line 493

def to_xml(name=nil)
  el = super(name)
  
  el.attributes["#{obj_ns.prefix}:Name"] = self.name.to_s
  el.add_element(self.allow.to_xml('Allow')) if self.allow
  el.add_element(self.arg.to_xml('Arg'))
  
  collapse_namespaces(el)
  el
end