Class: VORuby::STC::V1_30::CoordFITSColumnsType
- Inherits:
-
Object
- Object
- VORuby::STC::V1_30::CoordFITSColumnsType
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
Refers coordinate components to specific columns in the FITS file HDU.
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#name ⇒ Object
Returns the value of attribute name.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
- #==(c) ⇒ Object
-
#initialize(options = {}) ⇒ CoordFITSColumnsType
constructor
A new instance of CoordFITSColumnsType.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ CoordFITSColumnsType
Returns a new instance of CoordFITSColumnsType.
3114 3115 3116 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3114 def initialize(={}) .each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def error @error end |
#name ⇒ Object
Returns the value of attribute name.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def name @name end |
#pix_size ⇒ Object
Returns the value of attribute pix_size.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def pix_size @pix_size end |
#resolution ⇒ Object
Returns the value of attribute resolution.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def resolution @resolution end |
#size ⇒ Object
Returns the value of attribute size.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def size @size end |
#value ⇒ Object
Returns the value of attribute value.
3111 3112 3113 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3111 def value @value end |
Class Method Details
.from_xml(xml) ⇒ Object
3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3198 def self.from_xml(xml) root = element_from(xml) = {} name = REXML::XPath.first(root, 'x:Name', {'x' => obj_ns.uri}) [:name] = name.text if name value = REXML::XPath.first(root, 'x:Value', {'x' => obj_ns.uri}) [:value] = value.text if value error = REXML::XPath.first(root, 'x:Error', {'x' => obj_ns.uri}) [:error] = error.text if error resolution = REXML::XPath.first(root, 'x:Resolution', {'x' => obj_ns.uri}) [:resolution] = resolution.text if resolution size = REXML::XPath.first(root, 'x:Size', {'x' => obj_ns.uri}) [:size] = size.text if size pix_size = REXML::XPath.first(root, 'x:PixSize', {'x' => obj_ns.uri}) [:pix_size] = pix_size.text if pix_size self.new() end |
Instance Method Details
#==(c) ⇒ Object
3147 3148 3149 3150 3151 3152 3153 3154 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3147 def ==(c) self.name == c.name and self.value == c.value and self.error == c.error and self.resolution == c.resolution and self.size == c.size and self.pix_size == c.pix_size end |
#to_xml(name = nil) ⇒ Object
3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3156 def to_xml(name=nil) el = element(name) if self.name name_el = REXML::Element.new("#{obj_ns.prefix}:Name") name_el.text = self.name el.add_element(name_el) end if self.value value_el = REXML::Element.new("#{obj_ns.prefix}:Value") value_el.text = self.value el.add_element(value_el) end if self.error error_el = REXML::Element.new("#{obj_ns.prefix}:Error") error_el.text = self.error el.add_element(error_el) end if self.resolution resolution_el = REXML::Element.new("#{obj_ns.prefix}:Resolution") resolution_el.text = self.resolution el.add_element(resolution_el) end if self.size size_el = REXML::Element.new("#{obj_ns.prefix}:Size") size_el.text = self.size el.add_element(size_el) end if self.pix_size pix_size_el = REXML::Element.new("#{obj_ns.prefix}:PixSize") pix_size_el.text = self.pix_size el.add_element(pix_size_el) end el end |