Class: VORuby::STC::V1_10::STC::PixelCoordAreaType
- Inherits:
-
CoordAreaType
- Object
- CoordAreaType
- VORuby::STC::V1_10::STC::PixelCoordAreaType
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CoordScalarIntervalList
Instance Attribute Summary collapse
-
#coord_intervals ⇒ Object
Returns the value of attribute coord_intervals.
Attributes inherited from CoordAreaType
#coord_system_id, #id, #redshift_intervals, #spatial_interval, #spectral_intervals, #time_intervals, #vel_intervals
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PixelCoordAreaType
constructor
A new instance of PixelCoordAreaType.
Methods inherited from CoordAreaType
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ PixelCoordAreaType
Returns a new instance of PixelCoordAreaType.
2718 2719 2720 2721 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2718 def initialize(={}) raise_argument_required_error('list of coordinate scalar intervals') if !.has_key?(:coord_intervals) super() end |
Instance Attribute Details
#coord_intervals ⇒ Object
Returns the value of attribute coord_intervals.
2712 2713 2714 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2712 def coord_intervals @coord_intervals end |
Class Method Details
.from_xml(xml) ⇒ Object
2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2732 def self.from_xml(xml) root = element_from(xml) = { :id => Id.new(root.attributes.get_attribute_ns(obj_ns.uri, 'ID').value), :coord_system_id => IdRef.new(root.attributes.get_attribute_ns(obj_ns.uri, 'coord_system_id').value) } time_intervals = REXML::XPath.match(root, 'x:TimeInterval', {'x' => obj_ns.uri}) [:time_intervals] = TimeIntervalList.new(time_intervals.collect{ |i| TimeIntervalType.from_xml(i) }) if time_intervals [:time_intervals] = nil if time_intervals and [:time_intervals].size == 0 [:spatial_interval] = xml_to_obj(root, SpatialInterval, true) [:vel_intervals] = xml_to_obj(root, VelInterval) [:vel_intervals] = nil if [:vel_intervals].size == 0 spectral_intervals = REXML::XPath.match(root, 'x:SpectralInterval', {'x' => obj_ns.uri}) [:spectral_intervals] = SpectralIntervalList.new(spectral_intervals.collect{ |i| SpectralInterval.from_xml(i) }) if spectral_intervals [:spectral_intervals] = nil if spectral_intervals and [:spectral_intervals].size == 0 redshift_intervals = REXML::XPath.match(root, 'x:RedshiftInterval', {'x' => obj_ns.uri}) [:redshift_intervals] = RedshiftIntervalList.new(redshift_intervals.collect{ |i| RedshiftInterval.from_xml(i) }) if redshift_intervals [:redshift_intervals] = nil if redshift_intervals and [:redshift_intervals].size == 0 [:coord_intervals] = xml_to_obj(root, CoordScalarInterval) [:coord_intervals] = nil if [:coord_intervals].size == 0 self.new() end |