Class: GeoIP::City

Inherits:
Struct
  • Object
show all
Defined in:
lib/geoip.rb

Overview

Warning: for historical reasons the region code is mis-named region_name here

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#area_codeObject

Returns the value of attribute area_code

Returns:

  • (Object)

    the current value of area_code


183
184
185
# File 'lib/geoip.rb', line 183

def area_code
  @area_code
end

#city_nameObject

Returns the value of attribute city_name

Returns:

  • (Object)

    the current value of city_name


183
184
185
# File 'lib/geoip.rb', line 183

def city_name
  @city_name
end

#continent_codeObject

Returns the value of attribute continent_code

Returns:

  • (Object)

    the current value of continent_code


183
184
185
# File 'lib/geoip.rb', line 183

def continent_code
  @continent_code
end

#country_code2Object

Returns the value of attribute country_code2

Returns:

  • (Object)

    the current value of country_code2


183
184
185
# File 'lib/geoip.rb', line 183

def country_code2
  @country_code2
end

#country_code3Object

Returns the value of attribute country_code3

Returns:

  • (Object)

    the current value of country_code3


183
184
185
# File 'lib/geoip.rb', line 183

def country_code3
  @country_code3
end

#country_nameObject

Returns the value of attribute country_name

Returns:

  • (Object)

    the current value of country_name


183
184
185
# File 'lib/geoip.rb', line 183

def country_name
  @country_name
end

#dma_codeObject

Returns the value of attribute dma_code

Returns:

  • (Object)

    the current value of dma_code


183
184
185
# File 'lib/geoip.rb', line 183

def dma_code
  @dma_code
end

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip


183
184
185
# File 'lib/geoip.rb', line 183

def ip
  @ip
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude


183
184
185
# File 'lib/geoip.rb', line 183

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude


183
184
185
# File 'lib/geoip.rb', line 183

def longitude
  @longitude
end

#postal_codeObject

Returns the value of attribute postal_code

Returns:

  • (Object)

    the current value of postal_code


183
184
185
# File 'lib/geoip.rb', line 183

def postal_code
  @postal_code
end

#real_region_nameObject

Returns the value of attribute real_region_name

Returns:

  • (Object)

    the current value of real_region_name


183
184
185
# File 'lib/geoip.rb', line 183

def real_region_name
  @real_region_name
end

#region_nameObject

Returns the value of attribute region_name

Returns:

  • (Object)

    the current value of region_name


183
184
185
# File 'lib/geoip.rb', line 183

def region_name
  @region_name
end

#requestObject

Returns the value of attribute request

Returns:

  • (Object)

    the current value of request


183
184
185
# File 'lib/geoip.rb', line 183

def request
  @request
end

#timezoneObject

Returns the value of attribute timezone

Returns:

  • (Object)

    the current value of timezone


183
184
185
# File 'lib/geoip.rb', line 183

def timezone
  @timezone
end

Instance Method Details

#region_codeObject


190
191
192
# File 'lib/geoip.rb', line 190

def region_code
  self.region_name
end

#to_hashObject


186
187
188
# File 'lib/geoip.rb', line 186

def to_hash
  Hash[each_pair.to_a]
end