Class: VORuby::STC::V1_10::Coords::ScalarCoordinateType
- Inherits:
-
CoordinateType
- Object
- CoordinateType
- VORuby::STC::V1_10::Coords::ScalarCoordinateType
- Defined in:
- lib/voruby/stc/1.10/coords.rb
Overview
Generic scalar coordinate type. Single CError, CResolution, CSize, CPixSize elements indicate definite values; pairs indicate ranges.
Direct Known Subclasses
Position1D, Redshift, ScalarCoordinate, Spectral, Velocity1D
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#pix_size ⇒ Object
Returns the value of attribute pix_size.
-
#resolution ⇒ Object
Returns the value of attribute resolution.
-
#size ⇒ Object
Returns the value of attribute size.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from CoordinateType
Instance Method Summary collapse
- #==(sc) ⇒ Object
-
#initialize(options = {}) ⇒ ScalarCoordinateType
constructor
A new instance of ScalarCoordinateType.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ ScalarCoordinateType
Returns a new instance of ScalarCoordinateType.
674 675 676 |
# File 'lib/voruby/stc/1.10/coords.rb', line 674 def initialize(={}) .each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
672 673 674 |
# File 'lib/voruby/stc/1.10/coords.rb', line 672 def error @error end |
#pix_size ⇒ Object
Returns the value of attribute pix_size.
672 673 674 |
# File 'lib/voruby/stc/1.10/coords.rb', line 672 def pix_size @pix_size end |
#resolution ⇒ Object
Returns the value of attribute resolution.
672 673 674 |
# File 'lib/voruby/stc/1.10/coords.rb', line 672 def resolution @resolution end |
#size ⇒ Object
Returns the value of attribute size.
672 673 674 |
# File 'lib/voruby/stc/1.10/coords.rb', line 672 def size @size end |
#value ⇒ Object
Returns the value of attribute value.
672 673 674 |
# File 'lib/voruby/stc/1.10/coords.rb', line 672 def value @value end |
Instance Method Details
#==(sc) ⇒ Object
757 758 759 760 761 762 763 764 |
# File 'lib/voruby/stc/1.10/coords.rb', line 757 def ==(sc) super(sc) and self.value == sc.value and self.error == sc.error and self.resolution == sc.resolution and self.size == sc.size and self.pix_size == sc.pix_size end |
#to_xml(name = nil) ⇒ Object
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
# File 'lib/voruby/stc/1.10/coords.rb', line 738 def to_xml(name=nil) el = element(name) name = REXML::Element.new("#{obj_ns.prefix}:Name") name.text = self.name el.add_element(name) el.add_element(self.value.to_xml) if self.value self.error.each { |e| el.add_element(e.to_xml) } if self.error self.resolution.each { |r| el.add_element(r.to_xml) } if self.resolution self.size.each { |s| el.add_element(s.to_xml) } if self.size self.pix_size.each { |p| el.add_element(p.to_xml) } if self.pix_size collapse_namespaces(el) el end |