Module: MaxMindDB

Defined in:
lib/maxminddb.rb,
lib/maxminddb/reader.rb,
lib/maxminddb/result.rb,
lib/maxminddb/version.rb,
lib/maxminddb/result/postal.rb,
lib/maxminddb/result/traits.rb,
lib/maxminddb/result/location.rb,
lib/maxminddb/result/subdivisions.rb,
lib/maxminddb/result/named_location.rb

Defined Under Namespace

Classes: Client, LowMemoryReader, Result

Constant Summary collapse

DEFAULT_FILE_READER =

The default reader for MaxMindDB files. Reads the database into memory. This creates a higher memory overhead, but faster lookup times.

proc { |path| File.binread(path) }
LOW_MEMORY_FILE_READER =

A low memory file reader for MaxMindDB files. Avoids reading the database into memory. Has a lower memory footprint but slower lookup times.

proc { |path| MaxMindDB::LowMemoryReader.new(path) }
VERSION =
"0.1.22"

Class Method Summary collapse

Class Method Details

.new(path, file_reader = DEFAULT_FILE_READER) ⇒ Object


16
17
18
# File 'lib/maxminddb.rb', line 16

def self.new(path, file_reader=DEFAULT_FILE_READER)
  Client.new(path, file_reader)
end