Class: IpToEarth::Client
- Inherits:
-
Object
- Object
- IpToEarth::Client
- Defined in:
- lib/ip_to_earth/client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(api_key: Configuration.api_key) ⇒ Client
constructor
A new instance of Client.
- #lookup(ip) ⇒ Object
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
.default ⇒ Object
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 |