Sha256: 5ae69d3ec701e9a13dd544910cb7b93a097ce8bafafdc96dbdbabe26de9f700b

Contents?: true

Size: 538 Bytes

Versions: 55

Compression:

Stored size: 538 Bytes

Contents

module Stripe
  class SingletonAPIResource < APIResource
    def self.resource_url
      if self == SingletonAPIResource
        raise NotImplementedError.new('SingletonAPIResource is an abstract class.  You should perform actions on its subclasses (Account, etc.)')
      end
      "/v1/#{CGI.escape(class_name.downcase)}"
    end

    def resource_url
      self.class.resource_url
    end

    def self.retrieve(opts={})
      instance = self.new(nil, Util.normalize_opts(opts))
      instance.refresh
      instance
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
stripe-1.49.0 lib/stripe/singleton_api_resource.rb
stripe-1.48.0 lib/stripe/singleton_api_resource.rb
stripe-1.47.0 lib/stripe/singleton_api_resource.rb
stripe-1.46.0 lib/stripe/singleton_api_resource.rb
stripe-1.45.0 lib/stripe/singleton_api_resource.rb
stripe-1.44.0 lib/stripe/singleton_api_resource.rb
stripe-1.43.1 lib/stripe/singleton_api_resource.rb
stripe-1.43.0 lib/stripe/singleton_api_resource.rb
stripe-1.42.0 lib/stripe/singleton_api_resource.rb
stripe-1.41.0 lib/stripe/singleton_api_resource.rb
stripe-1.40.0 lib/stripe/singleton_api_resource.rb
stripe-1.39.0 lib/stripe/singleton_api_resource.rb
stripe-1.38.0 lib/stripe/singleton_api_resource.rb
stripe-1.37.0 lib/stripe/singleton_api_resource.rb
stripe-1.36.2 lib/stripe/singleton_api_resource.rb