Sha256: 24d0b2f3e0ea7cc397cac6fb9df6f61e30606af4378ca75c6fffb2d9df510ec6

Contents?: true

Size: 479 Bytes

Versions: 4

Compression:

Stored size: 479 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.instance_variable_get('@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

4 entries across 4 versions & 1 rubygems

Version Path
ip2location_ruby-8.0.1 lib/ip2location_ruby/i2l_string_data.rb
ip2location_ruby-7.0.0 lib/ip2location_ruby/i2l_string_data.rb
ip2location_ruby-0.3.2 lib/ip2location_ruby/i2l_string_data.rb
ip2location_ruby-0.3.1 lib/ip2location_ruby/i2l_string_data.rb