wunderlist-api 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wunderlist/reminder.rb +37 -0
- data/lib/wunderlist/subtask.rb +7 -7
- data/lib/wunderlist/task.rb +16 -0
- data/lib/wunderlist/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a4777c15d9bae7e02bf6d78b25a64b9eebe2e3
|
4
|
+
data.tar.gz: 4ed8fd0f2829cbde2fc9875823c3b6e4d337863d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 345d66b1a82a976de605231d6526989a4eb67e989f0c9f22c65f8e2eb643376aaf10f270a57ac1625f4b1cb38a4149495a353b4a12f7b0636b9456940a84a93a
|
7
|
+
data.tar.gz: 2967897975b72c44a9e9fa95401bad0bc3f405c77a74681a5b8d5e20d9de8edb65f0ea134aa8db6d303913f1736672d0ff9615243cff3a7cccf92012a0ac8ff3
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'wunderlist/helper'
|
2
|
+
|
3
|
+
module Wunderlist
|
4
|
+
class Reminder
|
5
|
+
|
6
|
+
include Wunderlist::Helper
|
7
|
+
|
8
|
+
attr_accessor :id, :api, :task_id, :created_at, :updated_at, :date, :revision
|
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
|
+
@updated_at = attrs['updated_at']
|
16
|
+
@date = attrs['date']
|
17
|
+
@revision = attrs['revision']
|
18
|
+
end
|
19
|
+
|
20
|
+
def date=(value)
|
21
|
+
@date = Time.parse(value).getlocal.iso8601
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def set_attrs(attrs = {})
|
27
|
+
self.id = attrs['id']
|
28
|
+
self.api = attrs['api']
|
29
|
+
self.task_id = attrs['task_id']
|
30
|
+
self.created_at = attrs['created_at']
|
31
|
+
self.updated_at = attrs['updated_at']
|
32
|
+
self.date = attrs['date']
|
33
|
+
self.revision = attrs['revision']
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
data/lib/wunderlist/subtask.rb
CHANGED
@@ -20,13 +20,13 @@ module Wunderlist
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def set_attrs(attrs = {})
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
self.id = attrs['id']
|
24
|
+
self.api = attrs['api']
|
25
|
+
self.task_id = attrs['task_id']
|
26
|
+
self.created_at = attrs['created_at']
|
27
|
+
self.created_by_id = attrs['created_by_id']
|
28
|
+
self.revision = attrs['revision']
|
29
|
+
self.title = attrs['title']
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
data/lib/wunderlist/task.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'wunderlist/note'
|
2
2
|
require 'wunderlist/task_comment'
|
3
3
|
require 'wunderlist/subtask'
|
4
|
+
require 'wunderlist/reminder'
|
4
5
|
require 'wunderlist/helper'
|
5
6
|
|
6
7
|
module Wunderlist
|
@@ -63,6 +64,21 @@ module Wunderlist
|
|
63
64
|
|
64
65
|
end
|
65
66
|
|
67
|
+
def reminder
|
68
|
+
res = self.api.request :get, 'api/v1/reminders', {:task_id => self.id}
|
69
|
+
if !res[0].nil?
|
70
|
+
reminder = Wunderlist::Rminder.new(res[0])
|
71
|
+
else
|
72
|
+
reminder = Wunderlist::Reminder.new('task_id' => self.id)
|
73
|
+
end
|
74
|
+
|
75
|
+
reminder.api = self.api
|
76
|
+
reminder.task_id = self.id
|
77
|
+
|
78
|
+
reminder
|
79
|
+
|
80
|
+
end
|
81
|
+
|
66
82
|
def new_subtask(attrs = {})
|
67
83
|
attrs.stringify_keys
|
68
84
|
s_t = Wunderlist::Subtask.new(attrs)
|
data/lib/wunderlist/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wunderlist-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shun3475
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/wunderlist/helper.rb
|
99
99
|
- lib/wunderlist/list.rb
|
100
100
|
- lib/wunderlist/note.rb
|
101
|
+
- lib/wunderlist/reminder.rb
|
101
102
|
- lib/wunderlist/subtask.rb
|
102
103
|
- lib/wunderlist/task.rb
|
103
104
|
- lib/wunderlist/task_comment.rb
|