Class: IpToEarth::Client

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: Configuration.api_key) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/ip_to_earth/client.rb', line 7

def initialize(api_key: Configuration.api_key)
  @api_controller = APIController.new(api_key: api_key)
end

Class Method Details

.defaultObject



3
4
5
# File 'lib/ip_to_earth/client.rb', line 3

def self.default
  @default_instance ||= new
end

Instance Method Details

#lookup(ip) ⇒ Object



11
12
13
# File 'lib/ip_to_earth/client.rb', line 11

def lookup(ip)
  @api_controller.lookup(ip)
end