Class: IPis::Lookup

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Lookup

Returns a new instance of Lookup.



10
11
12
13
14
15
16
17
# File 'lib/ipis.rb', line 10

def initialize(args)
  @ips_to_lookup = args.map(&:strip).uniq
  if @ips_to_lookup.size == 0
    @ips_to_lookup = [''] # fix self
  end
  @query_adapter = IPis::Queries::IPApi
  @formatter_adapter = IPis::Formatters::BaseFormatter
end

Instance Method Details

#runObject



19
20
21
22
23
24
# File 'lib/ipis.rb', line 19

def run
  @ips_to_lookup.each do |ip|
    puts show(ip)
    puts
  end
end