Class: Wunderlist::Webhook

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/wunderlist/webhook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#create, #model_name, #path, #plural_model_name, #resource_path, #save, #to_hash, #update

Constructor Details

#initialize(attrs = {}) ⇒ Webhook

Returns a new instance of Webhook.



8
9
10
11
12
13
14
15
16
# File 'lib/wunderlist/webhook.rb', line 8

def initialize(attrs = {})
  @id = attrs['id']
  @list_id = attrs['list_id']
  @created_by_id = attrs['created_by_id']
  @processor_type = attrs['processor_type']
  @url = attrs['url']
  @created_at = attrs['created_at']
  @configuration = attrs['configuration']
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def api
  @api
end

#configurationObject

Returns the value of attribute configuration.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def configuration
  @configuration
end

#created_atObject

Returns the value of attribute created_at.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def created_at
  @created_at
end

#created_by_idObject

Returns the value of attribute created_by_id.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def created_by_id
  @created_by_id
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def id
  @id
end

#list_idObject

Returns the value of attribute list_id.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def list_id
  @list_id
end

#processor_typeObject

Returns the value of attribute processor_type.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def processor_type
  @processor_type
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/wunderlist/webhook.rb', line 6

def url
  @url
end

Instance Method Details

#destroyObject



18
19
20
21
22
23
24
# File 'lib/wunderlist/webhook.rb', line 18

def destroy
  # Seems no revision id is needed, contrary to documentation
  self.api.request :delete, resource_path
  self.id = nil

  self
end