Module: Paysio::Actions::Update

Included in:
Charge, Coupon, Customer, Reward, Wallet
Defined in:
lib/paysio/actions/update.rb

Instance Method Summary collapse

Instance Method Details

#saveObject



9
10
11
12
13
# File 'lib/paysio/actions/update.rb', line 9

def save
  @previously_changed = changes
  @changed_attributes.clear
  update(changed_attributes)
end

#update(attrs = {}) ⇒ Object



4
5
6
7
# File 'lib/paysio/actions/update.rb', line 4

def update(attrs = {})
  response = Paysio::Client.request(:put, path, attrs)
  response["error"].blank? ? refresh_from(response.to_hash) : response
end