Sha256: 0e2351f40b52bccf27caffe3372ad95085999eff423d7dd7253a915d65a5693a

Contents?: true

Size: 474 Bytes

Versions: 3

Compression:

Stored size: 474 Bytes

Contents

module Stripe
  module APIOperations
    module Update
      def save(params={})
        # Let the caller override the URL but avoid serializing it.
        req_url = params.delete(:req_url) || url
        values = self.class.serialize_params(self).merge(params)

        if values.length > 0
          values.delete(:id)

          response, opts = request(:post, req_url, values)
          refresh_from(response, opts)
        end
        self
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stripe-1.27.2 lib/stripe/api_operations/update.rb
stripe-1.27.1 lib/stripe/api_operations/update.rb
stripe-1.27.0 lib/stripe/api_operations/update.rb