Class: APIGeoloc::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/apigeoloc/cli.rb

Overview

Simple CLI for apigeoloc

Instance Method Summary collapse

Instance Method Details

#match(url, cidr) ⇒ Object



83
84
85
86
87
88
# File 'lib/apigeoloc/cli.rb', line 83

def match(url, cidr)
  opts = options.dup
  matcher = APIGeoloc::Matcher.new.send(opts['source'], url, cidr, opts) \
    unless opts['simulation']
  matcher.match unless opts['simulation']
end

#versionObject



24
25
26
# File 'lib/apigeoloc/cli.rb', line 24

def version
  puts "APIGeoloc version #{APIGeoloc::VERSION}"
end