Method: MiniMime::Db::RandomAccessDb#initialize

Defined in:
lib/mini_mime.rb

#initialize(path, sort_order) ⇒ RandomAccessDb

Returns a new instance of RandomAccessDb.



117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/mini_mime.rb', line 117

def initialize(path, sort_order)
  @path = path
  @file = PReadFile.new(@path)

  @row_length = @file.readline("\n").length
  @file_length = File.size(@path)
  @rows = @file_length / @row_length

  @hit_cache = Cache.new(MAX_CACHED)
  @miss_cache = Cache.new(MAX_CACHED)

  @sort_order = sort_order
end