Class: Dnsign::IpResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsign/ip_resolver.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service = IpResolvers::IpInfoIo, opts = {}) ⇒ IpResolver

Returns a new instance of IpResolver.


6
7
8
# File 'lib/dnsign/ip_resolver.rb', line 6

def initialize(service=IpResolvers::IpInfoIo, opts={})
  @resolver = service.new self
end

Class Method Details

.resolve(*args) ⇒ Object


16
17
18
# File 'lib/dnsign/ip_resolver.rb', line 16

def self.resolve(*args)
  self.new(*args).resolve
end

Instance Method Details

#resolveObject


10
11
12
13
14
# File 'lib/dnsign/ip_resolver.rb', line 10

def resolve
  @resolver.fetch
rescue => e
  puts "#{e.class}: #{e.message}"
end