Class: I2lIpData

Inherits:
BinData::BasePrimitive
  • Object
show all
Defined in:
lib/ip2location_ruby/i2l_ip_data.rb

Instance Method Summary collapse

Instance Method Details

#read_and_return_value(io) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/ip2location_ruby/i2l_ip_data.rb', line 2

def read_and_return_value(io)
  iv = eval_parameter(:ip_version)
  if iv == 4
    BinData::Uint32le.read(io)
  elsif iv == 6
    BinData::Uint128le.read(io)
  end
end