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-3.3.2 lib/stripe/singleton_api_resource.rb
stripe-3.3.1 lib/stripe/singleton_api_resource.rb
stripe-3.3.0 lib/stripe/singleton_api_resource.rb
stripe-3.2.0 lib/stripe/singleton_api_resource.rb
stripe-3.1.0 lib/stripe/singleton_api_resource.rb
stripe-3.0.3 lib/stripe/singleton_api_resource.rb
stripe-3.0.1 lib/stripe/singleton_api_resource.rb
stripe-3.0.0 lib/stripe/singleton_api_resource.rb
stripe-2.12.0 lib/stripe/singleton_api_resource.rb
stripe-2.11.0 lib/stripe/singleton_api_resource.rb
stripe-2.10.0 lib/stripe/singleton_api_resource.rb
stripe-2.9.0 lib/stripe/singleton_api_resource.rb
stripe-2.8.0 lib/stripe/singleton_api_resource.rb
stripe-2.7.0 lib/stripe/singleton_api_resource.rb
stripe-2.6.0 lib/stripe/singleton_api_resource.rb
stripe-2.5.0 lib/stripe/singleton_api_resource.rb
stripe-2.4.0 lib/stripe/singleton_api_resource.rb
stripe-2.3.0 lib/stripe/singleton_api_resource.rb
stripe-2.2.1 lib/stripe/singleton_api_resource.rb
stripe-2.2.0 lib/stripe/singleton_api_resource.rb