Module: Stripe::APIOperations::SingletonSave::ClassMethods
- Defined in:
- lib/stripe/api_operations/singleton_save.rb
Instance Method Summary collapse
-
#update(params = {}, opts = {}) ⇒ Object
Updates a singleton API resource.
Instance Method Details
#update(params = {}, opts = {}) ⇒ Object
Updates a singleton API resource
Updates the identified resource with the passed in parameters.
Attributes
-
params
- A hash of parameters to pass to the API -
opts
- A Hash of additional options (separate from the params / object values) to be added to the request. E.g. to allow for an idempotency_key to be passed in the request headers, or for the api_key to be overwritten. See APIOperations::Request.execute_resource_request.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stripe/api_operations/singleton_save.rb', line 19 def update(params = {}, opts = {}) params.each_key do |k| raise ArgumentError, "Cannot update protected field: #{k}" if protected_fields.include?(k) end request_stripe_object( method: :post, path: resource_url, params: params, opts: opts ) end |