Class: Ephem::IO::DAF

Inherits:
Object
  • Object
show all
Defined in:
lib/ephem/io/daf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#endiannessObject (readonly)

Returns the value of attribute endianness.



6
7
8
# File 'lib/ephem/io/daf.rb', line 6

def endianness
  @endianness
end

#record_dataObject (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

#closeObject



33
34
35
# File 'lib/ephem/io/daf.rb', line 33

def close
  @binary_reader&.close
end

#commentsObject



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