logan 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logan/todo.rb +16 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6693a0249ee8419b0677c7eb5aeed071f775dfca
|
4
|
+
data.tar.gz: 1f91aa04d498e44f07fca9f3eb12820e4c48a415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a49cc959c5bd8247ee7658be881789c1b4c3fbec3ccc96c991759856c86de2e34f8e788ca03872610a20ebf3755011fb0c5bec7e4c34e1c9dd543300ff0c1fb1
|
7
|
+
data.tar.gz: 0e7d6419b8c64962eb9fb06610a0546d05e52a0558958467c1b0d9e80454dc27ed1d518e0481a7324625d9227b6ae60395a42cfbb63379ecc9e2d54c0621b389
|
data/lib/logan/todo.rb
CHANGED
@@ -5,7 +5,7 @@ require 'logan/person'
|
|
5
5
|
module Logan
|
6
6
|
class Todo
|
7
7
|
include HashConstructed
|
8
|
-
|
8
|
+
|
9
9
|
attr_accessor :id
|
10
10
|
attr_accessor :project_id
|
11
11
|
attr_accessor :content
|
@@ -13,7 +13,8 @@ module Logan
|
|
13
13
|
attr_accessor :comments_count
|
14
14
|
attr_reader :assignee
|
15
15
|
attr_accessor :due_at
|
16
|
-
|
16
|
+
attr_accessor :position
|
17
|
+
|
17
18
|
def post_json
|
18
19
|
{
|
19
20
|
:content => @content,
|
@@ -21,44 +22,45 @@ module Logan
|
|
21
22
|
:assignee => @assignee.blank? ? nil : @assignee.to_hash
|
22
23
|
}.to_json
|
23
24
|
end
|
24
|
-
|
25
|
+
|
25
26
|
def put_json
|
26
|
-
{
|
27
|
-
:content => @content,
|
27
|
+
{
|
28
|
+
:content => @content,
|
28
29
|
:due_at => @due_at,
|
29
30
|
:assignee => @assignee.blank? ? nil : @assignee.to_hash,
|
31
|
+
:position => @position.blank? ? 99 : @position,
|
30
32
|
:completed => @completed
|
31
33
|
}.to_json
|
32
34
|
end
|
33
|
-
|
35
|
+
|
34
36
|
# refreshes the data for this todo from the API
|
35
37
|
def refresh
|
36
38
|
response = Logan::Client.get "/projects/#{project_id}/todos/#{id}.json"
|
37
39
|
initialize(response.parsed_response)
|
38
40
|
end
|
39
|
-
|
41
|
+
|
40
42
|
# returns the array of comments - potentially synchronously downloaded from API
|
41
|
-
#
|
43
|
+
#
|
42
44
|
# @return [Array<Logan::Comment] Array of comments on this todo
|
43
45
|
def comments
|
44
46
|
refresh if (@comments.nil? || @comments.empty?) && @comments_count > 0
|
45
47
|
@comments ||= Array.new
|
46
48
|
end
|
47
|
-
|
49
|
+
|
48
50
|
# assigns the {#comments} from the passed array
|
49
|
-
#
|
51
|
+
#
|
50
52
|
# @param [Array<Object>] comment_array array of hash comments from API or <Logan::Comment> objects
|
51
53
|
# @return [Array<Logan::Comment>] array of comments for this todo
|
52
54
|
def comments=(comment_array)
|
53
55
|
@comments = comment_array.map { |obj| obj = Logan::Comment.new obj if obj.is_a?(Hash) }
|
54
56
|
end
|
55
|
-
|
57
|
+
|
56
58
|
# sets the assignee for this todo
|
57
|
-
#
|
59
|
+
#
|
58
60
|
# @param [Object] assignee person hash from API or <Logan::Person> object
|
59
61
|
# @return [Logan::Person] the assignee for this todo
|
60
62
|
def assignee=(assignee)
|
61
|
-
@assignee = assignee.is_a?(Hash) ? Logan::Person.new(assignee) : assignee
|
63
|
+
@assignee = assignee.is_a?(Hash) ? Logan::Person.new(assignee) : assignee
|
62
64
|
end
|
63
|
-
end
|
65
|
+
end
|
64
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Birarda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|