Class: Ephem::IO::DAF
- Inherits:
-
Object
- Object
- Ephem::IO::DAF
- Defined in:
- lib/ephem/io/daf.rb
Instance Attribute Summary collapse
-
#endianness ⇒ Object
readonly
Returns the value of attribute endianness.
-
#record_data ⇒ Object
readonly
Returns the value of attribute record_data.
Instance Method Summary collapse
- #close ⇒ Object
- #comments ⇒ Object
-
#initialize(file_object) ⇒ DAF
constructor
A new instance of DAF.
- #read_array(start_word, end_word) ⇒ Object (also: #map_array)
- #summaries(&block) ⇒ Object
Constructor Details
#initialize(file_object) ⇒ DAF
Returns a new instance of DAF.
8 9 10 11 12 |
# File 'lib/ephem/io/daf.rb', line 8 def initialize(file_object) @binary_reader = BinaryReader.new(file_object) setup_file_format setup_summary_manager end |
Instance Attribute Details
#endianness ⇒ Object (readonly)
Returns the value of attribute endianness.
6 7 8 |
# File 'lib/ephem/io/daf.rb', line 6 def endianness @endianness end |
#record_data ⇒ Object (readonly)
Returns the value of attribute record_data.
6 7 8 |
# File 'lib/ephem/io/daf.rb', line 6 def record_data @record_data end |
Instance Method Details
#close ⇒ Object
33 34 35 |
# File 'lib/ephem/io/daf.rb', line 33 def close @binary_reader&.close end |
#comments ⇒ Object
14 15 16 |
# File 'lib/ephem/io/daf.rb', line 14 def comments @comments ||= load_comments end |
#read_array(start_word, end_word) ⇒ Object Also known as: map_array
24 25 26 27 28 29 30 |
# File 'lib/ephem/io/daf.rb', line 24 def read_array(start_word, end_word) @binary_reader.read_array( start_word: start_word, end_word: end_word, endianness: @endianness ) end |
#summaries(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/ephem/io/daf.rb', line 18 def summaries(&block) return enum_for(:summaries) unless block_given? @summary_manager.each_summary(&block) end |