Class: Wunderlist::List

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

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

Constructor Details

#initialize(attrs = {}) ⇒ List

Returns a new instance of List.



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

def initialize(attrs = {})
  @api = attrs['api']
  @id = attrs['id']
  @title = attrs['title']
  @created_at = attrs['created_at']
  @revision = attrs['revision']
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



8
9
10
# File 'lib/wunderlist/list.rb', line 8

def api
  @api
end

#created_atObject

Returns the value of attribute created_at.



8
9
10
# File 'lib/wunderlist/list.rb', line 8

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/wunderlist/list.rb', line 8

def id
  @id
end

#revisionObject

Returns the value of attribute revision.



8
9
10
# File 'lib/wunderlist/list.rb', line 8

def revision
  @revision
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/wunderlist/list.rb', line 8

def title
  @title
end

Instance Method Details

#new_task(attrs = {}) ⇒ Object



18
19
20
# File 'lib/wunderlist/list.rb', line 18

def new_task(attrs = {})
  self.api.new_task(self.title, attrs)
end

#tasks(completed: false) ⇒ Object



22
23
24
# File 'lib/wunderlist/list.rb', line 22

def tasks(completed: false)
  self.api.tasks([self.title], completed)
end

#webhooksObject



26
27
28
# File 'lib/wunderlist/list.rb', line 26

def webhooks
  self.api.webhooks(self.title)
end