Sha256: c50c0396cb97d305013bdbccc20e370b410da1cd96242e5f430903c550f156f8
Contents?: true
Size: 721 Bytes
Versions: 44
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true module Stripe class SingletonAPIResource < APIResource def self.resource_url if self == SingletonAPIResource raise NotImplementedError, "SingletonAPIResource is an abstract class. You should perform actions on its subclasses (Account, etc.)" end # Namespaces are separated in object names with periods (.) and in URLs # with forward slashes (/), so replace the former with the latter. "/v1/#{self::OBJECT_NAME.downcase.tr('.', '/')}" end def resource_url self.class.resource_url end def self.retrieve(opts = {}) instance = new(nil, Util.normalize_opts(opts)) instance.refresh instance end end end
Version data entries
44 entries across 44 versions & 1 rubygems