Module: CurrencyCloud::Actions::Update

Defined in:
lib/currency_cloud/actions/update.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



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

def self.extended(base)
  base.send(:include, Save) # Private before Ruby 2.1
end

Instance Method Details

#update(id, params) ⇒ Object

TODO: Add .save instance method, which calls update on changed attributes



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

def update(id, params)
  attrs = client.post(id.to_s, params)
  new(attrs)
end