Class: VORuby::STC::V1_30::ObsDataLocationType
- Inherits:
-
STCMetadataType
- Object
- STCBaseType
- STCMetadataType
- VORuby::STC::V1_30::ObsDataLocationType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
Type for observational STC metadata.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#observation_location ⇒ Object
Returns the value of attribute observation_location.
-
#observatory_location ⇒ Object
Returns the value of attribute observatory_location.
-
#pixel_space ⇒ Object
Returns the value of attribute pixel_space.
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
- #==(l) ⇒ Object
-
#initialize(observatory_location, observation_location, pixel_space = nil, options = {}) ⇒ ObsDataLocationType
constructor
A new instance of ObsDataLocationType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from STCMetadataType
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(observatory_location, observation_location, pixel_space = nil, options = {}) ⇒ ObsDataLocationType
Returns a new instance of ObsDataLocationType.
8365 8366 8367 8368 8369 8370 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8365 def initialize(observatory_location, observation_location, pixel_space=nil, ={}) super() self.observatory_location = observatory_location self.observation_location = observation_location self.pixel_space = pixel_space end |
Instance Attribute Details
#observation_location ⇒ Object
Returns the value of attribute observation_location.
8363 8364 8365 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8363 def observation_location @observation_location end |
#observatory_location ⇒ Object
Returns the value of attribute observatory_location.
8363 8364 8365 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8363 def observatory_location @observatory_location end |
#pixel_space ⇒ Object
Returns the value of attribute pixel_space.
8363 8364 8365 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8363 def pixel_space @pixel_space end |
Class Method Details
.from_xml(xml) ⇒ Object
8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8405 def self.from_xml(xml) root = element_from(xml) observatory = REXML::XPath.first(root, 'x:ObservatoryLocation', {'x' => obj_ns.uri}) observation = REXML::XPath.first(root, 'x:ObservationLocation', {'x' => obj_ns.uri}) space = REXML::XPath.first(root, 'x:PixelSpace', {'x' => obj_ns.uri}) self.new( observatory ? ObservatoryLocationType.from_xml(observatory) : nil, observation ? AstroSTCDescriptionType.from_xml(observation) : nil, space ? PixelSpaceType.from_xml(space) : nil, *STCMetadataType.(root) ) end |
Instance Method Details
#==(l) ⇒ Object
8387 8388 8389 8390 8391 8392 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8387 def ==(l) super(l) and self.observatory_location == l.observatory_location and self.observation_location == l.observation_location and self.pixel_space == l.pixel_space end |
#to_xml(name = nil) ⇒ Object
8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 |
# File 'lib/voruby/stc/1.30/stc.rb', line 8394 def to_xml(name=nil) el = super(name) el.add_element(self.observatory_location.to_xml('ObservatoryLocation')) if self.observatory_location el.add_element(self.observation_location.to_xml('ObservationLocation')) if self.observation_location el.add_element(self.pixel_space.to_xml('PixelSpace')) if self.pixel_space collapse_namespaces(el) el end |