Method: Celery::EndpointMethods::InstanceMethods#update

Defined in:
lib/celery/endpoint_methods.rb

#update(attrs = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/celery/endpoint_methods.rb', line 48

def update(attrs={})
  update_local_object(attrs)

  response = HTTParty.put(
    "#{self.class.endpoint_path}/#{self.id}?#{self.class.options}",
    body:    { self.class.object_root => attrs }.to_json,
    headers: { 'Content-Type' => 'application/json' }
  )

  return true if response[self.class.object_root]
end