Class: VORuby::ADQL::V1_0::ClosedSearch

Inherits:
Search
  • Object
show all
Defined in:
lib/voruby/adql/1.0/adql.rb

Overview

Represents expressions like (A)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(condition) ⇒ ClosedSearch

Returns a new instance of ClosedSearch.



1292
1293
1294
# File 'lib/voruby/adql/1.0/adql.rb', line 1292

def initialize(condition)
  self.condition = condition
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



1288
1289
1290
# File 'lib/voruby/adql/1.0/adql.rb', line 1288

def condition
  @condition
end

Class Method Details

.from_xml(xml) ⇒ Object



1317
1318
1319
1320
1321
# File 'lib/voruby/adql/1.0/adql.rb', line 1317

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(xml_to_obj(REXML::XPath.first(root, 'x:Condition', {'x' => obj_ns.uri})))
end

.xml_typeObject



1290
# File 'lib/voruby/adql/1.0/adql.rb', line 1290

def self.xml_type; 'closedSearchType' end

Instance Method Details

#==(s) ⇒ Object



1302
1303
1304
# File 'lib/voruby/adql/1.0/adql.rb', line 1302

def ==(s)
  self.condition == s.condition
end

#to_sObject



1306
1307
1308
# File 'lib/voruby/adql/1.0/adql.rb', line 1306

def to_s
  "(#{self.condition})"
end

#to_xml(name = nil) ⇒ Object



1310
1311
1312
1313
1314
1315
# File 'lib/voruby/adql/1.0/adql.rb', line 1310

def to_xml(name=nil)
  el = super(name)
  el.add_element(self.condition.to_xml('Condition'))
  collapse_namespaces(el)
  el
end