Module: CoinbaseCommerce::APIResources::Base::Save

Included in:
Checkout
Defined in:
lib/coinbase_commerce/api_resources/base/save.rb

Overview

save operations mixin

Instance Method Summary collapse

Instance Method Details

#saveObject



8
9
10
11
12
13
14
# File 'lib/coinbase_commerce/api_resources/base/save.rb', line 8

def save
  values = serialize_params(self)
  values.delete(:id)
  resp = @client.request(:put, "#{self.class::RESOURCE_PATH}/#{self[:id]}", self)
  initialize_from(resp.data)
  self
end