Class: Ephem::IO::DAF
- Inherits:
-
Object
- Object
- Ephem::IO::DAF
- Defined in:
- lib/ephem/io/daf.rb
Instance Attribute Summary collapse
-
#binary_reader ⇒ Object
readonly
Returns the value of attribute binary_reader.
-
#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
- #file_type ⇒ Symbol?
-
#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
#binary_reader ⇒ Object (readonly)
Returns the value of attribute binary_reader.
6 7 8 |
# File 'lib/ephem/io/daf.rb', line 6 def binary_reader @binary_reader end |
#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
38 39 40 |
# File 'lib/ephem/io/daf.rb', line 38 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 |
#file_type ⇒ Symbol?
19 20 21 |
# File 'lib/ephem/io/daf.rb', line 19 def file_type @file_type ||= detect_file_type end |
#read_array(start_word, end_word) ⇒ Object Also known as: map_array
29 30 31 32 33 34 35 |
# File 'lib/ephem/io/daf.rb', line 29 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
23 24 25 26 27 |
# File 'lib/ephem/io/daf.rb', line 23 def summaries(&block) return enum_for(:summaries) unless block_given? @summary_manager.each_summary(&block) end |