basecampeverest 0.1.1 → 0.1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/basecampeverest/resources/topics.rb +71 -67
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70726638b40f614cee73986a839aa976a437dc30
|
4
|
+
data.tar.gz: 9c708f37e0f7ebbc7f2afcbccdf0a2fd278c29c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35f1c11eaf6f9a57216a344974a5277003b3f3ed7915c59f59946fc06a3619b05d0d9968def3c31802fc81d3d7fa66aafb1fbaeb295c606896b7e09483e87328
|
7
|
+
data.tar.gz: 17e6c8d93bac275d151e792f47b02e67891a253cde487e1731e9b1937a13a32cb9f5408d1fda8f9c1bb3eddea31adca28cc291da4c29e78203d9ba2ee6425f4c
|
@@ -1,83 +1,87 @@
|
|
1
1
|
module Basecampeverest; class Topics
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
# find all #### via the Basecamp API
|
4
|
+
#
|
5
|
+
# @return [Basecampeverest::Project] #### from the Basecamp API
|
6
|
+
def self.all
|
7
|
+
url =
|
8
|
+
response = Basecampeverest::Connect.get
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
# parse the response to remove HTTParty info
|
11
|
+
response.parsed_response
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
# #### via the Basecamp API
|
15
|
+
#
|
16
|
+
# @param [Basecampeverest::Project] ####
|
17
|
+
# @return [Basecampeverest::Project] #### from the Basecamp API
|
18
|
+
def self.find()
|
19
|
+
url =
|
20
|
+
response = Basecampeverest::Connect.get
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
# parse the response to remove HTTParty info
|
23
|
+
response.parsed_response
|
24
|
+
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
# #### via the Basecamp API
|
27
|
+
#
|
28
|
+
#
|
29
|
+
# @param [Basecampeverest::Project] ####
|
30
|
+
# @param [Basecampeverest::Project] ####
|
31
|
+
# @return [Basecampeverest::Project] #### from the Basecamp API
|
32
|
+
def self.new(options={})
|
33
|
+
post_params = {
|
34
|
+
:body => options.to_json,
|
35
|
+
:headers => Basecampeverest::Connect.headers.merge({'Content-Type' => 'application/json'})
|
36
|
+
}
|
37
|
+
# make the http basecamp call
|
38
|
+
url = "####"
|
39
|
+
response = Basecampeverest::Connect.post url, post_params
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
# parse the response to remove HTTParty info
|
42
|
+
response.parsed_response
|
43
|
+
end
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
# #### via the Basecamp API
|
46
|
+
#
|
47
|
+
# @param [Basecampeverest::Project] ####
|
48
|
+
# @param [Basecampeverest::Project] ####
|
49
|
+
# @return [Basecampeverest::Project] from the Basecamp API
|
50
|
+
def self.update()
|
51
|
+
post_params = {
|
52
|
+
:body => options.to_json,
|
53
|
+
:headers => Basecampeverest::Connect.merge({'Content-Type' => 'application/json'})
|
54
|
+
}
|
52
55
|
|
53
|
-
|
54
|
-
|
56
|
+
# make the http basecamp call
|
57
|
+
url =
|
58
|
+
response = Basecampeverest::Connect.put url, post_params
|
55
59
|
|
56
|
-
|
57
|
-
|
58
|
-
|
60
|
+
# parse the response to remove HTTParty info
|
61
|
+
response.parsed_response
|
62
|
+
end
|
59
63
|
|
60
64
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
# #### via the Basecamp API
|
66
|
+
#
|
67
|
+
# @param [Basecampeverest::Project] ####
|
68
|
+
# @return [Basecampeverest::Project] ####
|
69
|
+
def self.delete()
|
70
|
+
url = "####"
|
71
|
+
response = Basecampeverest::Connect.delete url
|
68
72
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
# This checks the response code for validity and error checking
|
74
|
+
if response.code == 204
|
75
|
+
message = "#### successfully deleted"
|
76
|
+
elsif response.code == 403
|
77
|
+
message = "You do not have permission to delete this ####"
|
78
|
+
else
|
79
|
+
message = "Invalid project ID or authentication. The #### was not deleted."
|
80
|
+
end
|
77
81
|
|
78
|
-
|
79
|
-
|
80
|
-
|
82
|
+
# return the message
|
83
|
+
message
|
84
|
+
end
|
81
85
|
|
82
|
-
|
86
|
+
# end module and class
|
83
87
|
end; end
|