Class: Freegeoip::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/freegeoip/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
# File 'lib/freegeoip/response.rb', line 7

def initialize(attrs)
  attrs.each do |key, value|
    instance_variable_set "@#{key}", value
  end
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def city
  @city
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def country_code
  @country_code
end

#country_nameObject (readonly)

Returns the value of attribute country_name.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def country_name
  @country_name
end

#ipObject (readonly)

Returns the value of attribute ip.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def ip
  @ip
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def longitude
  @longitude
end

#metro_codeObject (readonly)

Returns the value of attribute metro_code.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def metro_code
  @metro_code
end

#region_codeObject (readonly)

Returns the value of attribute region_code.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def region_code
  @region_code
end

#region_nameObject (readonly)

Returns the value of attribute region_name.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def region_name
  @region_name
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def time_zone
  @time_zone
end

#zip_codeObject (readonly)

Returns the value of attribute zip_code.



3
4
5
# File 'lib/freegeoip/response.rb', line 3

def zip_code
  @zip_code
end