Class: GeoIP::Country

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#continent_codeObject

Returns the value of attribute continent_code

Returns:

  • (Object)

    the current value of continent_code



109
110
111
# File 'lib/geoip.rb', line 109

def continent_code
  @continent_code
end

#country_codeObject

Returns the value of attribute country_code

Returns:

  • (Object)

    the current value of country_code



109
110
111
# File 'lib/geoip.rb', line 109

def country_code
  @country_code
end

#country_code2Object

Returns the value of attribute country_code2

Returns:

  • (Object)

    the current value of country_code2



109
110
111
# File 'lib/geoip.rb', line 109

def country_code2
  @country_code2
end

#country_code3Object

Returns the value of attribute country_code3

Returns:

  • (Object)

    the current value of country_code3



109
110
111
# File 'lib/geoip.rb', line 109

def country_code3
  @country_code3
end

#country_nameObject

Returns the value of attribute country_name

Returns:

  • (Object)

    the current value of country_name



109
110
111
# File 'lib/geoip.rb', line 109

def country_name
  @country_name
end

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip



109
110
111
# File 'lib/geoip.rb', line 109

def ip
  @ip
end

#requestObject

Returns the value of attribute request

Returns:

  • (Object)

    the current value of request



109
110
111
# File 'lib/geoip.rb', line 109

def request
  @request
end

Instance Method Details

#to_hashObject



110
111
112
# File 'lib/geoip.rb', line 110

def to_hash
  Hash[each_pair.to_a].each_with_object({}) { |(k,v), h| h[k.to_sym] = v }
end