Class: Wunderlist::List
- Inherits:
-
Object
- Object
- Wunderlist::List
- Includes:
- Helper
- Defined in:
- lib/wunderlist/list.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#revision ⇒ Object
Returns the value of attribute revision.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ List
constructor
A new instance of List.
- #new_task(attrs = {}) ⇒ Object
- #tasks(completed: false) ⇒ Object
- #webhooks ⇒ Object
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
#api ⇒ Object
Returns the value of attribute api.
8 9 10 |
# File 'lib/wunderlist/list.rb', line 8 def api @api end |
#created_at ⇒ Object
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/wunderlist/list.rb', line 8 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/wunderlist/list.rb', line 8 def id @id end |
#revision ⇒ Object
Returns the value of attribute revision.
8 9 10 |
# File 'lib/wunderlist/list.rb', line 8 def revision @revision end |
#title ⇒ Object
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 |
#webhooks ⇒ Object
26 27 28 |
# File 'lib/wunderlist/list.rb', line 26 def webhooks self.api.webhooks(self.title) end |