wunderlist-api 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/wunderlist/list.rb +16 -12
- data/lib/wunderlist/note.rb +16 -16
- data/lib/wunderlist/subtask.rb +33 -0
- data/lib/wunderlist/task.rb +44 -20
- data/lib/wunderlist/task_comment.rb +16 -16
- data/lib/wunderlist/version.rb +1 -1
- metadata +3 -3
- data/.travis.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 031a07e0769feb8d29e850090f1c80d68cc0790e
|
4
|
+
data.tar.gz: 3bf147f95a1814be13d3d9c5fc57290a44fd00d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13e0acf1aa75b911b0b3a956a210375aad0fd42cbbb96f71b48ec42df00ec381c13a4343f7bf9619b509b02b1e6adb3e3c4b1975e97667c45159ac067468b714
|
7
|
+
data.tar.gz: ca27362e6fbdf20b8fec1ef7ae7e8272be7ab8ce304335134182a0e8744a67dfc622b076ae52c631ae52ea79b37c5f91451e0b7130de861aebe261bba62ef500
|
data/README.md
CHANGED
data/lib/wunderlist/list.rb
CHANGED
@@ -7,12 +7,16 @@ module Wunderlist
|
|
7
7
|
|
8
8
|
attr_accessor :id, :title, :api, :created_at, :revision
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@api =
|
12
|
-
@id =
|
13
|
-
@title =
|
14
|
-
@created_at =
|
15
|
-
@revision =
|
10
|
+
def initialize(attrs = {})
|
11
|
+
@api = attrs['api']
|
12
|
+
@id = attrs['id']
|
13
|
+
@title = attrs['title']
|
14
|
+
@created_at = attrs['created_at']
|
15
|
+
@revision = attrs['revision']
|
16
|
+
end
|
17
|
+
|
18
|
+
def new_task(list_name, attrs = {})
|
19
|
+
self.api.new_task(list_name, attrs)
|
16
20
|
end
|
17
21
|
|
18
22
|
def tasks(completed = false)
|
@@ -21,12 +25,12 @@ module Wunderlist
|
|
21
25
|
|
22
26
|
private
|
23
27
|
|
24
|
-
def set_attrs(
|
25
|
-
self.api =
|
26
|
-
self.id =
|
27
|
-
self.title=
|
28
|
-
self.created_at =
|
29
|
-
self.revision =
|
28
|
+
def set_attrs(attrs = {})
|
29
|
+
self.api = attrs['api']
|
30
|
+
self.id = attrs['id']
|
31
|
+
self.title= attrs['content']
|
32
|
+
self.created_at = attrs['created_at']
|
33
|
+
self.revision = attrs['revision']
|
30
34
|
end
|
31
35
|
|
32
36
|
end
|
data/lib/wunderlist/note.rb
CHANGED
@@ -7,26 +7,26 @@ module Wunderlist
|
|
7
7
|
|
8
8
|
attr_accessor :id, :content, :api, :task_id, :created_at, :updated_at, :revision
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@api =
|
12
|
-
@id =
|
13
|
-
@task_id =
|
14
|
-
@content =
|
15
|
-
@created_at =
|
16
|
-
@updated_at =
|
17
|
-
@revision =
|
10
|
+
def initialize(attrs = {})
|
11
|
+
@api = attrs['api']
|
12
|
+
@id = attrs['id']
|
13
|
+
@task_id = attrs['task_id']
|
14
|
+
@content = attrs['content']
|
15
|
+
@created_at = attrs['created_at']
|
16
|
+
@updated_at = attrs['updated_at']
|
17
|
+
@revision = attrs['revision']
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
-
def set_attrs(
|
23
|
-
self.api =
|
24
|
-
self.id =
|
25
|
-
self.task_id =
|
26
|
-
self.content =
|
27
|
-
self.created_at =
|
28
|
-
self.updated_at =
|
29
|
-
self.revision =
|
22
|
+
def set_attrs(attrs = {})
|
23
|
+
self.api = attrs['api']
|
24
|
+
self.id = attrs['id']
|
25
|
+
self.task_id = attrs['task_id']
|
26
|
+
self.content = attrs['content']
|
27
|
+
self.created_at = attrs['created_at']
|
28
|
+
self.updated_at = attrs['updated_at']
|
29
|
+
self.revision = attrs['revision']
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'wunderlist/helper'
|
2
|
+
|
3
|
+
module Wunderlist
|
4
|
+
class Subtask
|
5
|
+
|
6
|
+
include Wunderlist::Helper
|
7
|
+
|
8
|
+
attr_accessor :id, :api, :task_id, :created_at, :created_by_id, :revision, :title
|
9
|
+
|
10
|
+
def initialize(attrs = {})
|
11
|
+
@id = attrs['id']
|
12
|
+
@api = attrs['api']
|
13
|
+
@task_id = attrs['task_id']
|
14
|
+
@created_at = attrs['created_at']
|
15
|
+
@created_by_id = attrs['created_by_id']
|
16
|
+
@revision = attrs['revision']
|
17
|
+
@title = attrs['title']
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def set_attrs(attrs = {})
|
23
|
+
@id = attrs['id']
|
24
|
+
@api = attrs['api']
|
25
|
+
@task_id = attrs['task_id']
|
26
|
+
@created_at = attrs['created_at']
|
27
|
+
@created_by_id = attrs['created_by_id']
|
28
|
+
@revision = attrs['revision']
|
29
|
+
@title = attrs['title']
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
data/lib/wunderlist/task.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'wunderlist/note'
|
2
2
|
require 'wunderlist/task_comment'
|
3
|
+
require 'wunderlist/subtask'
|
3
4
|
require 'wunderlist/helper'
|
4
5
|
|
5
6
|
module Wunderlist
|
@@ -9,18 +10,18 @@ module Wunderlist
|
|
9
10
|
|
10
11
|
attr_accessor :api, :title, :assignee_id, :completed, :revision, :recurrence_type, :recurrence_count, :due_date, :starred, :id, :list_id, :created_at
|
11
12
|
|
12
|
-
def initialize(
|
13
|
-
@api =
|
14
|
-
@id =
|
15
|
-
@list_id =
|
16
|
-
@title =
|
17
|
-
@revision =
|
18
|
-
@assignee_id =
|
19
|
-
@completed =
|
20
|
-
@recurrence_type =
|
21
|
-
@recurrence_count =
|
22
|
-
@due_date =
|
23
|
-
@starred =
|
13
|
+
def initialize(attrs = {})
|
14
|
+
@api = attrs['api']
|
15
|
+
@id = attrs['id']
|
16
|
+
@list_id = attrs['list_id']
|
17
|
+
@title = attrs['title']
|
18
|
+
@revision = attrs['revision']
|
19
|
+
@assignee_id = attrs['assignee_id']
|
20
|
+
@completed = attrs['completed']
|
21
|
+
@recurrence_type = attrs['recurrence_type']
|
22
|
+
@recurrence_count = attrs['recurrence_count']
|
23
|
+
@due_date = attrs['due_date']
|
24
|
+
@starred = attrs['starred']
|
24
25
|
end
|
25
26
|
|
26
27
|
def task_comments
|
@@ -62,16 +63,39 @@ module Wunderlist
|
|
62
63
|
|
63
64
|
end
|
64
65
|
|
66
|
+
def new_subtask(attrs = {})
|
67
|
+
attrs.stringify_keys
|
68
|
+
s_t = Wunderlist::Subtask.new(attrs)
|
69
|
+
s_t.api = self.api
|
70
|
+
s_t.task_id = self.id
|
71
|
+
|
72
|
+
s_t
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
def subtasks
|
77
|
+
res = self.api.request :get, 'api/v1/subtasks', {:task_id => self.id}
|
78
|
+
subtasks = []
|
79
|
+
res.each do |r|
|
80
|
+
subtask = Wunderlist::Subtask.new(r)
|
81
|
+
subtask.api = self
|
82
|
+
subtasks << subtask
|
83
|
+
end
|
84
|
+
|
85
|
+
subtasks
|
86
|
+
|
87
|
+
end
|
88
|
+
|
65
89
|
private
|
66
90
|
|
67
|
-
def set_attrs(
|
68
|
-
self.id =
|
69
|
-
self.title =
|
70
|
-
self.created_at =
|
71
|
-
self.completed =
|
72
|
-
self.list_id =
|
73
|
-
self.starred =
|
74
|
-
self.revision =
|
91
|
+
def set_attrs(attrs = {})
|
92
|
+
self.id = attrs['id']
|
93
|
+
self.title = attrs['title']
|
94
|
+
self.created_at = attrs['created_at']
|
95
|
+
self.completed = attrs['completed']
|
96
|
+
self.list_id = attrs['list_id']
|
97
|
+
self.starred = attrs['starred']
|
98
|
+
self.revision = attrs['revision']
|
75
99
|
end
|
76
100
|
|
77
101
|
end
|
@@ -7,26 +7,26 @@ module Wunderlist
|
|
7
7
|
|
8
8
|
attr_accessor :text, :type, :id, :api, :task_id, :revision, :created_at
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@api =
|
12
|
-
@id =
|
13
|
-
@task_id =
|
14
|
-
@revision =
|
15
|
-
@text =
|
16
|
-
@type =
|
17
|
-
@created_at =
|
10
|
+
def initialize(attrs = {})
|
11
|
+
@api = attrs['api']
|
12
|
+
@id = attrs['id']
|
13
|
+
@task_id = attrs['task_id']
|
14
|
+
@revision = attrs['revision']
|
15
|
+
@text = attrs['text']
|
16
|
+
@type = attrs['type']
|
17
|
+
@created_at = attrs['created_at']
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
-
def set_attrs(
|
23
|
-
self.api =
|
24
|
-
self.id =
|
25
|
-
self.task_id =
|
26
|
-
self.revision =
|
27
|
-
self.text =
|
28
|
-
self.type =
|
29
|
-
self.created_at =
|
22
|
+
def set_attrs(attrs = {})
|
23
|
+
self.api = attrs['api']
|
24
|
+
self.id = attrs['id']
|
25
|
+
self.task_id = attrs['task_id']
|
26
|
+
self.revision = attrs['revision']
|
27
|
+
self.text = attrs['text']
|
28
|
+
self.type = attrs['type']
|
29
|
+
self.created_at = attrs['created_at']
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
data/lib/wunderlist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wunderlist-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shun3475
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,7 +89,6 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
92
|
- Gemfile
|
94
93
|
- LICENSE.txt
|
95
94
|
- README.md
|
@@ -99,6 +98,7 @@ files:
|
|
99
98
|
- lib/wunderlist/helper.rb
|
100
99
|
- lib/wunderlist/list.rb
|
101
100
|
- lib/wunderlist/note.rb
|
101
|
+
- lib/wunderlist/subtask.rb
|
102
102
|
- lib/wunderlist/task.rb
|
103
103
|
- lib/wunderlist/task_comment.rb
|
104
104
|
- lib/wunderlist/version.rb
|
data/.travis.yml
DELETED