Class: VORuby::VOTables::VOTable::Data::FITSStream
- Defined in:
- lib/voruby/votables/data.rb,
lib/voruby/votables/rexml_parser.rb,
lib/voruby/votables/libxml_parser.rb
Overview
A class representing a FITS stream.
Instance Attribute Summary collapse
-
#extnum ⇒ Object
readonly
Returns the value of attribute extnum.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream = nil, extnum = nil) ⇒ FITSStream
constructor
- stream:
-
The basic stream informatin (type: Stream).
- #to_s ⇒ Object
Constructor Details
#initialize(stream = nil, extnum = nil) ⇒ FITSStream
- stream:
-
The basic stream informatin (type: Stream).
- extnum:
-
The number of extensions in the FITS file (type Type::PositiveInteger).
80 81 82 83 84 85 86 87 |
# File 'lib/voruby/votables/data.rb', line 80 def initialize(stream=nil, extnum=nil) raise Misc::TypeException(stream, Stream) if stream and !stream.is_a?(Stream) Misc::TypeCheck.new(stream, Stream).check() @stream = stream Misc::TypeCheck.new(extnum, Type::PositiveInteger).check() @extnum = extnum end |
Instance Attribute Details
#extnum ⇒ Object (readonly)
Returns the value of attribute extnum.
74 75 76 |
# File 'lib/voruby/votables/data.rb', line 74 def extnum @extnum end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
74 75 76 |
# File 'lib/voruby/votables/data.rb', line 74 def stream @stream end |
Class Method Details
.from_xml(node) ⇒ Object
346 347 348 349 350 351 |
# File 'lib/voruby/votables/rexml_parser.rb', line 346 def self.from_xml(node) stream = Stream.from_xml(node.elements.each('STREAM').first) extnum = Type::PositiveInteger.new(node.attributes['extnum'].to_i) if node.attributes['extnum'] return self.new(stream, extnum) end |
Instance Method Details
#to_s ⇒ Object
89 90 91 |
# File 'lib/voruby/votables/data.rb', line 89 def to_s "{stream=#{@stream};extnum=#{extnum}}" end |