Class: GeoIPs

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_ips.rb,
lib/geo_ips/version.rb

Constant Summary collapse

BASE_URI =
'http://api.geoips.com'
VERSION =
"0.1.2"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ GeoIPs

Returns a new instance of GeoIPs.



10
11
12
# File 'lib/geo_ips.rb', line 10

def initialize api_key
  @api_key = api_key
end

Instance Attribute Details

#api_key=(value) ⇒ Object (writeonly)

Sets the attribute api_key

Parameters:

  • value

    the value to set the attribute api_key to.



8
9
10
# File 'lib/geo_ips.rb', line 8

def api_key=(value)
  @api_key = value
end

Instance Method Details

#lookup(ip) ⇒ Object



14
15
16
# File 'lib/geo_ips.rb', line 14

def lookup ip
  request(ip)
end