Class: IpToEarth::APIResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def city
  @city
end

#continent_codeObject

Returns the value of attribute continent_code

Returns:

  • (Object)

    the current value of continent_code



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def continent_code
  @continent_code
end

#countryObject

Returns the value of attribute country

Returns:

  • (Object)

    the current value of country



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def country
  @country
end

#country_codeObject

Returns the value of attribute country_code

Returns:

  • (Object)

    the current value of country_code



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def country_code
  @country_code
end

#country_code3Object

Returns the value of attribute country_code3

Returns:

  • (Object)

    the current value of country_code3



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def country_code3
  @country_code3
end

#currency_codeObject

Returns the value of attribute currency_code

Returns:

  • (Object)

    the current value of currency_code



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def currency_code
  @currency_code
end

#hostnameObject

Returns the value of attribute hostname

Returns:

  • (Object)

    the current value of hostname



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def hostname
  @hostname
end

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def ip
  @ip
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def longitude
  @longitude
end

#regionObject

Returns the value of attribute region

Returns:

  • (Object)

    the current value of region



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def region
  @region
end

#validObject

Returns the value of attribute valid

Returns:

  • (Object)

    the current value of valid



2
3
4
# File 'lib/ip_to_earth/api_result.rb', line 2

def valid
  @valid
end