class UrlScan::Commands::Base

Public Instance Methods

api() click to toggle source
# File lib/urlscan/commands/base.rb, line 12
def api
  options.key?("API_KEY") ? API.new(options["API_KEY"]) : API.new
end
with_error_handling() { || ... } click to toggle source
# File lib/urlscan/commands/base.rb, line 16
def with_error_handling
  yield
rescue ArgumentError => _e
  puts "Warning: please specify your urlscan.io API key via ENV['URLSCAN_API_KEY'] or --API-KEY"
rescue ResponseError => e
  puts "Warning: #{e}"
end