wunderlist-api 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 031a07e0769feb8d29e850090f1c80d68cc0790e
4
- data.tar.gz: 3bf147f95a1814be13d3d9c5fc57290a44fd00d5
3
+ metadata.gz: d3a4777c15d9bae7e02bf6d78b25a64b9eebe2e3
4
+ data.tar.gz: 4ed8fd0f2829cbde2fc9875823c3b6e4d337863d
5
5
  SHA512:
6
- metadata.gz: 13e0acf1aa75b911b0b3a956a210375aad0fd42cbbb96f71b48ec42df00ec381c13a4343f7bf9619b509b02b1e6adb3e3c4b1975e97667c45159ac067468b714
7
- data.tar.gz: ca27362e6fbdf20b8fec1ef7ae7e8272be7ab8ce304335134182a0e8744a67dfc622b076ae52c631ae52ea79b37c5f91451e0b7130de861aebe261bba62ef500
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
@@ -20,13 +20,13 @@ module Wunderlist
20
20
  private
21
21
 
22
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']
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Wunderlist
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
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.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