Module: Paggi::Rest::Update::ClassMethods

Defined in:
lib/paggi/rest/update.rb

Instance Method Summary collapse

Instance Method Details

#update(params = {id: 0}, header = {}) ⇒ Object



37
38
39
40
41
# File 'lib/paggi/rest/update.rb', line 37

def update(params={id: 0}, header={})
  result = request(params[:id], params, :PUT, header)
  raise result if result.kind_of? StandardError
  result
end

#update!(params = {id: 0}, header = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/paggi/rest/update.rb', line 27

def update!(params={id: 0}, header={})
  begin
    update(params, header)
  rescue PaggiError => e
    build(params, e)
  rescue StandardError => e
    raise e
  end
end