Class: Micdrop::Ext::Microfocus::MicroFocusReader
- Inherits:
-
Object
- Object
- Micdrop::Ext::Microfocus::MicroFocusReader
- Defined in:
- lib/micdrop/ext/microfocus.rb
Overview
Read a MicroFocus data file
Instance Attribute Summary collapse
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#creation_time ⇒ Object
readonly
Returns the value of attribute creation_time.
-
#index_type ⇒ Object
readonly
Returns the value of attribute index_type.
-
#index_version ⇒ Object
readonly
Returns the value of attribute index_version.
-
#max_length ⇒ Object
readonly
Returns the value of attribute max_length.
-
#min_legth ⇒ Object
readonly
Returns the value of attribute min_legth.
-
#variable_length ⇒ Object
readonly
Returns the value of attribute variable_length.
Instance Method Summary collapse
- #each ⇒ Object
- #indexed? ⇒ Boolean
-
#initialize(data_file, unpack_spec: nil, unpack_mapping: nil) ⇒ MicroFocusReader
constructor
A new instance of MicroFocusReader.
- #long_records? ⇒ Boolean
- #relative? ⇒ Boolean
- #sequential? ⇒ Boolean
Constructor Details
#initialize(data_file, unpack_spec: nil, unpack_mapping: nil) ⇒ MicroFocusReader
Returns a new instance of MicroFocusReader.
70 71 72 73 74 75 |
# File 'lib/micdrop/ext/microfocus.rb', line 70 def initialize(data_file, unpack_spec: nil, unpack_mapping: nil) @data_file = data_file @unpack_spec = unpack_spec @unpack_mapping = unpack_mapping read_data_header end |
Instance Attribute Details
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def compression @compression end |
#creation_time ⇒ Object (readonly)
Returns the value of attribute creation_time.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def creation_time @creation_time end |
#index_type ⇒ Object (readonly)
Returns the value of attribute index_type.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def index_type @index_type end |
#index_version ⇒ Object (readonly)
Returns the value of attribute index_version.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def index_version @index_version end |
#max_length ⇒ Object (readonly)
Returns the value of attribute max_length.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def max_length @max_length end |
#min_legth ⇒ Object (readonly)
Returns the value of attribute min_legth.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def min_legth @min_legth end |
#variable_length ⇒ Object (readonly)
Returns the value of attribute variable_length.
77 78 79 |
# File 'lib/micdrop/ext/microfocus.rb', line 77 def variable_length @variable_length end |
Instance Method Details
#each ⇒ Object
95 96 97 98 99 |
# File 'lib/micdrop/ext/microfocus.rb', line 95 def each return enum_for :each unless block_given? yield read_record until @data_file.eof? end |
#indexed? ⇒ Boolean
87 88 89 |
# File 'lib/micdrop/ext/microfocus.rb', line 87 def indexed? @organization == RecordOrganization::INDEXED end |
#long_records? ⇒ Boolean
79 80 81 |
# File 'lib/micdrop/ext/microfocus.rb', line 79 def long_records? @long_records end |
#relative? ⇒ Boolean
91 92 93 |
# File 'lib/micdrop/ext/microfocus.rb', line 91 def relative? @organization == RecordOrganization::RELATIVE end |
#sequential? ⇒ Boolean
83 84 85 |
# File 'lib/micdrop/ext/microfocus.rb', line 83 def sequential? @organization == RecordOrganization::SEQUENTIAL end |