Class: VORuby::ADQL::V1_0::IntersectionSearch

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

Overview

Represents expressions like A And B

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(condition1, condition2) ⇒ IntersectionSearch

Returns a new instance of IntersectionSearch.



1042
1043
1044
1045
# File 'lib/voruby/adql/1.0/adql.rb', line 1042

def initialize(condition1, condition2)
  self.condition1 = condition1
  self.condition2 = condition2
end

Instance Attribute Details

#condition1Object

Returns the value of attribute condition1.



1038
1039
1040
# File 'lib/voruby/adql/1.0/adql.rb', line 1038

def condition1
  @condition1
end

#condition2Object

Returns the value of attribute condition2.



1038
1039
1040
# File 'lib/voruby/adql/1.0/adql.rb', line 1038

def condition2
  @condition2
end

Class Method Details

.from_xml(xml) ⇒ Object



1078
1079
1080
1081
1082
1083
# File 'lib/voruby/adql/1.0/adql.rb', line 1078

def self.from_xml(xml)
  root = element_from(xml)
  
  conds = REXML::XPath.match(root, 'x:Condition', {'x' => obj_ns.uri})
  self.new(xml_to_obj(conds[0]), xml_to_obj(conds[1]))
end

.xml_typeObject



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

def self.xml_type; 'intersectionSearchType' end

Instance Method Details

#==(s) ⇒ Object



1059
1060
1061
1062
# File 'lib/voruby/adql/1.0/adql.rb', line 1059

def ==(s)
  self.condition1 == s.condition1 and
  self.condition2 == s.condition2
end

#to_sObject



1064
1065
1066
# File 'lib/voruby/adql/1.0/adql.rb', line 1064

def to_s
  "#{self.condition1} AND #{self.condition2}"
end

#to_xml(name = nil) ⇒ Object



1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'lib/voruby/adql/1.0/adql.rb', line 1068

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