Class: IpToEarth::APIResult
- Inherits:
-
Struct
- Object
- Struct
- IpToEarth::APIResult
- Defined in:
- lib/ip_to_earth/api_result.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#continent_code ⇒ Object
Returns the value of attribute continent_code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#country_code3 ⇒ Object
Returns the value of attribute country_code3.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#region ⇒ Object
Returns the value of attribute region.
-
#valid ⇒ Object
Returns the value of attribute valid.
Instance Method Summary collapse
-
#initialize(args) ⇒ APIResult
constructor
NOTE: yes, keyword_init: true exists but raises an error on unknown keywords!.
Constructor Details
#initialize(args) ⇒ APIResult
NOTE: yes, keyword_init: true exists but raises an error on unknown keywords!
7 8 9 |
# File 'lib/ip_to_earth/api_result.rb', line 7 def initialize(args) members.each { |field| send("#{field}=", args[field.to_s]) } end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def city @city end |
#continent_code ⇒ Object
Returns the value of attribute continent_code
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def continent_code @continent_code end |
#country ⇒ Object
Returns the value of attribute country
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def country @country end |
#country_code ⇒ Object
Returns the value of attribute country_code
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def country_code @country_code end |
#country_code3 ⇒ Object
Returns the value of attribute country_code3
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def country_code3 @country_code3 end |
#currency_code ⇒ Object
Returns the value of attribute currency_code
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def currency_code @currency_code end |
#hostname ⇒ Object
Returns the value of attribute hostname
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def hostname @hostname end |
#ip ⇒ Object
Returns the value of attribute ip
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def ip @ip end |
#latitude ⇒ Object
Returns the value of attribute latitude
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def longitude @longitude end |
#region ⇒ Object
Returns the value of attribute region
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def region @region end |
#valid ⇒ Object
Returns the value of attribute valid
2 3 4 |
# File 'lib/ip_to_earth/api_result.rb', line 2 def valid @valid end |