class Pulsedive::CLI::Base

Public Instance Methods

api() click to toggle source
# File lib/pulsedive/cli.rb, line 12
def api
  options[:API_KEY] ? API.new(options[:API_KEY]) : API.new
end
with_error_handling() { || ... } click to toggle source
# File lib/pulsedive/cli.rb, line 16
def with_error_handling
  yield
rescue ResponseError => e
  puts "Warning: #{e}"
rescue ArgumentError => _e
  puts "Please provide your Pulsedive API key via --API_KEY or ENV['PULSEDIVE_API_KEY']"
end