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



134
135
136
# File 'lib/geoip.rb', line 134

def area_code
  @area_code
end

#city_nameObject

Returns the value of attribute city_name

Returns:

  • (Object)

    the current value of city_name



134
135
136
# File 'lib/geoip.rb', line 134

def city_name
  @city_name
end

#continent_codeObject

Returns the value of attribute continent_code

Returns:

  • (Object)

    the current value of continent_code



134
135
136
# File 'lib/geoip.rb', line 134

def continent_code
  @continent_code
end

#country_code2Object

Returns the value of attribute country_code2

Returns:

  • (Object)

    the current value of country_code2



134
135
136
# File 'lib/geoip.rb', line 134

def country_code2
  @country_code2
end

#country_code3Object

Returns the value of attribute country_code3

Returns:

  • (Object)

    the current value of country_code3



134
135
136
# File 'lib/geoip.rb', line 134

def country_code3
  @country_code3
end

#country_nameObject

Returns the value of attribute country_name

Returns:

  • (Object)

    the current value of country_name



134
135
136
# File 'lib/geoip.rb', line 134

def country_name
  @country_name
end

#dma_codeObject

Returns the value of attribute dma_code

Returns:

  • (Object)

    the current value of dma_code



134
135
136
# File 'lib/geoip.rb', line 134

def dma_code
  @dma_code
end

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip



134
135
136
# File 'lib/geoip.rb', line 134

def ip
  @ip
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



134
135
136
# File 'lib/geoip.rb', line 134

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



134
135
136
# File 'lib/geoip.rb', line 134

def longitude
  @longitude
end

#postal_codeObject

Returns the value of attribute postal_code

Returns:

  • (Object)

    the current value of postal_code



134
135
136
# File 'lib/geoip.rb', line 134

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



134
135
136
# File 'lib/geoip.rb', line 134

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



134
135
136
# File 'lib/geoip.rb', line 134

def region_name
  @region_name
end

#requestObject

Returns the value of attribute request

Returns:

  • (Object)

    the current value of request



134
135
136
# File 'lib/geoip.rb', line 134

def request
  @request
end

#timezoneObject

Returns the value of attribute timezone

Returns:

  • (Object)

    the current value of timezone



134
135
136
# File 'lib/geoip.rb', line 134

def timezone
  @timezone
end

Instance Method Details

#region_codeObject



141
142
143
# File 'lib/geoip.rb', line 141

def region_code
  self.region_name
end

#to_hashObject



137
138
139
# File 'lib/geoip.rb', line 137

def to_hash
  Hash[each_pair.to_a]
end