Module: Paymill::Operations::Update

Included in:
Client, Paymill::Offer, Subscription, Transaction, Webhook
Defined in:
lib/paymill/operations/update.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



15
16
17
# File 'lib/paymill/operations/update.rb', line 15

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#update_attributes(attributes) ⇒ Object

Updates a object

Parameters:

  • attributes (Hash)

    The attributes that should be updated



22
23
24
25
# File 'lib/paymill/operations/update.rb', line 22

def update_attributes(attributes)
  response = Paymill.request(:put, "#{self.class.name.split("::").last.downcase}s/#{id}", attributes)
  set_attributes(response["data"])
end