Skip to content

Instantly share code, notes, and snippets.

@cored
Created December 3, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cored/5ebf017060bccadaae26d37313ed4ae2 to your computer and use it in GitHub Desktop.
Save cored/5ebf017060bccadaae26d37313ed4ae2 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
module Checkr
module Internal
class Package < Resource
def self.get(package_id)
url = "/packages/#{package_id}"
key = ['get', url].join(':')
fetch(key, expire_in: 43_200) do
api.get(url)
end
end
def self.list(account_id, options = {})
url = "/accounts/#{account_id}/packages"
key = ['get', url, options.to_json].join(':')
fetch(key, expire_in: 43_200) do
api.get(url, options)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment