Sha256: bf56e8188596bae855d2f6d81504e81f101435fd198640a57a3fee7ff70975e3

Contents?: true

Size: 453 Bytes

Versions: 2

Compression:

Stored size: 453 Bytes

Contents

class I2lStringData  < BinData::BasePrimitive
  
  def read_and_return_value(io)
    country_long = eval_parameter(:country_long)
    io.seekbytes(-4) if country_long
    file = io.raw_io
    addr = BinData::Uint32le.read(io)
    old_offset = file.tell
    country_long ? file.seek(addr + 3) : file.seek(addr)
    length = BinData::Uint8.read(file)
    res = BinData::String.new(:length => length).read(file)
    file.seek(old_offset)
    res
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ip2location_ruby-0.2.0 lib/ip2location_ruby/i2l_string_data.rb
ip2location_ruby-0.1.2 lib/ip2location_ruby/i2l_string_data.rb