croudia 1.0.15 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.gitignore +1 -0
- data/README.md +4 -1
- data/lib/croudia/api/account.rb +16 -5
- data/lib/croudia/api/favorites.rb +16 -15
- data/lib/croudia/api/friendships.rb +84 -22
- data/lib/croudia/api/oauth.rb +20 -4
- data/lib/croudia/api/search.rb +34 -5
- data/lib/croudia/api/secret_mails.rb +29 -11
- data/lib/croudia/api/statuses.rb +56 -19
- data/lib/croudia/api/timelines.rb +43 -5
- data/lib/croudia/api/trends.rb +20 -0
- data/lib/croudia/api/users.rb +16 -4
- data/lib/croudia/base.rb +71 -71
- data/lib/croudia/client.rb +4 -3
- data/lib/croudia/creatable.rb +1 -0
- data/lib/croudia/default.rb +70 -70
- data/lib/croudia/error.rb +49 -49
- data/lib/croudia/identity.rb +1 -1
- data/lib/croudia/place.rb +10 -0
- data/lib/croudia/request/raise_error.rb +19 -19
- data/lib/croudia/response/raise_error.rb +38 -38
- data/lib/croudia/trend.rb +13 -0
- data/lib/croudia/trend_results.rb +24 -0
- data/lib/croudia/version.rb +1 -1
- data/spec/croudia/api/favorites_spec.rb +13 -29
- data/spec/croudia/api/trends_spec.rb +29 -0
- data/spec/croudia/error_spec.rb +46 -46
- data/spec/fixtures/trends.json +20 -0
- metadata +13 -6
- data/lib/croudia/ext/openssl.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NWQ4YmRkODRiMGQxYTkyM2Q5ZDQ3MGUxMjY3ZmIxNWYwNmU3ZTkwMA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzVkY2I2N2NhZjhmMDhlNGUyODg3Y2FmMGNkNjYxMzc0ODRmYzg3Mw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MTU5MzU5ZWVjMjZiMjJiOTEzMzUwZTcyZmFhNjhkODcyM2VkNTc0ZjgxMWQw
|
10
|
+
OWY1YWY4MDM2YmMxOTFiMWI0NzhjMTc3MDVmMWYyNTg5OTBlOTYxYjJiYTY0
|
11
|
+
ZmU0ZWJmZTBlNzkyNGM5YzEwYmIzOTcyZGVjYzFmMTc5YmM2MmI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWY1MjI4OGJiZWNjOTRhZDk4MTAyNTEzMDg2YWIwYTVkYjQ1ZWY3YTYxODVl
|
14
|
+
MjM0M2IyNmNiOGU2OGUzMDA4YTdkMmU4ZGU2YThkM2VkOGRlNWE3ZGY4Yzdk
|
15
|
+
OGE1NzlkOTkwNjUyNjQ0Njg2ZjIxMDNjNDZmMmZlMDM4MTk1Y2U=
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Croudia is a registered trademark of Croudia Inc. in Japan.
|
|
11
11
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
|
-
gem
|
14
|
+
gem "croudia", "~> 1.0"
|
15
15
|
|
16
16
|
And then execute:
|
17
17
|
|
@@ -66,6 +66,9 @@ home_timeline = croudia.home_timeline
|
|
66
66
|
posted_status = croudia.update("Hello!")
|
67
67
|
```
|
68
68
|
|
69
|
+
The full documentation of `Croudia::Client` is available at:
|
70
|
+
http://rdoc.info/gems/croudia/Croudia/Client
|
71
|
+
|
69
72
|
## Contributing
|
70
73
|
|
71
74
|
1. Fork it
|
data/lib/croudia/api/account.rb
CHANGED
@@ -5,7 +5,8 @@ module Croudia
|
|
5
5
|
module Account
|
6
6
|
# Retrieve the Authenticated User
|
7
7
|
#
|
8
|
-
# @
|
8
|
+
# @see https://developer.croudia.com/docs/35_account_verify_credentials
|
9
|
+
# @param [Hash] params Additional query parameterss
|
9
10
|
# @return [Croudia::User] Current user's object
|
10
11
|
def verify_credentials(params={})
|
11
12
|
resp = get('/account/verify_credentials.json', params)
|
@@ -15,9 +16,14 @@ module Croudia
|
|
15
16
|
|
16
17
|
# Update profile image
|
17
18
|
#
|
18
|
-
# @
|
19
|
-
# @
|
20
|
-
#
|
19
|
+
# @see https://developer.croudia.com/docs/36_account_update_profile_image
|
20
|
+
# @overload update_profile_image(image, params={})
|
21
|
+
# @param [File] image New profile image
|
22
|
+
# @param [Hash] params Addtional query parameters
|
23
|
+
# @overload update_profile_image(params={})
|
24
|
+
# @param [Hash] params Query parameters
|
25
|
+
# @option params [File] :image New profile image
|
26
|
+
# @return [Croudia::User] Current user's object updated
|
21
27
|
def update_profile_image(image, params={})
|
22
28
|
merge_file!(params, image, :image)
|
23
29
|
resp = post('/account/update_profile_image.json', params)
|
@@ -26,7 +32,12 @@ module Croudia
|
|
26
32
|
|
27
33
|
# Update profile
|
28
34
|
#
|
29
|
-
# @
|
35
|
+
# @see https://developer.croudia.com/docs/37_account_update_profile
|
36
|
+
# @param [Hash] params Additional query parameters
|
37
|
+
# @option params [String] :description Bio of the user
|
38
|
+
# @option params [String] :location Geo location
|
39
|
+
# @option params [String] :name Name of the user
|
40
|
+
# @option params [String] :url URL
|
30
41
|
# @return [Croudia::User] Updated profile
|
31
42
|
def update_profile(params)
|
32
43
|
resp = post('/account/update_profile.json', params)
|
@@ -5,25 +5,24 @@ module Croudia
|
|
5
5
|
module Favorites
|
6
6
|
# List of favorited statuses
|
7
7
|
#
|
8
|
-
# @
|
9
|
-
# @param
|
8
|
+
# @see https://developer.croudia.com/docs/51_favorites
|
9
|
+
# @param [Hash] params Additional query parameters
|
10
|
+
# @option params [String, Integer] :count Number of statuses in the response
|
11
|
+
# @option params [String] :include_entities Set false to exclude entities
|
12
|
+
# @option params [String, Integer] :max_id Paging parameter
|
13
|
+
# @option params [String, Integer] :since_id Paging parameter
|
10
14
|
# @return [Array<Croudia::Status>]
|
11
|
-
def favorites(
|
12
|
-
resp =
|
13
|
-
when Hash
|
14
|
-
params.merge!(user)
|
15
|
-
get('/favorites.json', params)
|
16
|
-
else
|
17
|
-
get("/favorites/#{user}.json", params)
|
18
|
-
end
|
19
|
-
|
15
|
+
def favorites(params={})
|
16
|
+
resp = get('/favorites.json', params)
|
20
17
|
objects(Croudia::Status, resp)
|
21
18
|
end
|
22
19
|
|
23
20
|
# Favorite a status
|
24
21
|
#
|
25
|
-
# @
|
26
|
-
# @param
|
22
|
+
# @see https://developer.croudia.com/docs/52_favorites_create
|
23
|
+
# @param [String, Integer, Croudia::Status] status_id ID of the status to favorite
|
24
|
+
# @param [Hash] params Additional query parameters
|
25
|
+
# @option params [String] :include_entities Set false to exclude entities
|
27
26
|
# @return [Croudia::Status] Favorited status
|
28
27
|
def favorite(status_id, params={})
|
29
28
|
status_id = get_id(status_id)
|
@@ -33,8 +32,10 @@ module Croudia
|
|
33
32
|
|
34
33
|
# Unfavorite a status
|
35
34
|
#
|
36
|
-
# @
|
37
|
-
# @param
|
35
|
+
# @see https://developer.croudia.com/docs/53_favorites_destroy
|
36
|
+
# @param [String, Integer, Croudia::Status] status_id ID of the status to unfavorite
|
37
|
+
# @param [Hash] params Additional query parameters
|
38
|
+
# @option params [String] :include_entities Set false to exclude entities
|
38
39
|
# @return [Croudia::Status] Unfavorited status
|
39
40
|
def unfavorite(status_id, params={})
|
40
41
|
status_id = get_id(status_id)
|
@@ -7,8 +7,14 @@ module Croudia
|
|
7
7
|
module Friendships
|
8
8
|
# Follow a user
|
9
9
|
#
|
10
|
-
# @
|
11
|
-
# @
|
10
|
+
# @see https://developer.croudia.com/docs/41_friendships_create
|
11
|
+
# @overload follow(user, params={})
|
12
|
+
# @param [String, Integer, Croudia::User] user User to follow
|
13
|
+
# @param [Hash] params Additional query parameters
|
14
|
+
# @overload follow(params={})
|
15
|
+
# @param [Hash] params Query parameters
|
16
|
+
# @option params [String] :screen_name Screen name of user to follow
|
17
|
+
# @option params [String, Integer] :user_id ID of user to follow
|
12
18
|
# @return [Croudia::User] Followed user
|
13
19
|
def follow(user, params={})
|
14
20
|
merge_user!(params, user)
|
@@ -18,8 +24,14 @@ module Croudia
|
|
18
24
|
|
19
25
|
# Unfollow a user
|
20
26
|
#
|
21
|
-
# @
|
22
|
-
# @
|
27
|
+
# @see https://developer.croudia.com/docs/42_friendships_destroy
|
28
|
+
# @overload unfollow(user, params={})
|
29
|
+
# @param [String, Integer, Croudia::User] user User to unfollow
|
30
|
+
# @param [Hash] params Additional query parameters
|
31
|
+
# @overload unfollow(params={})
|
32
|
+
# @param [Hash] params Query parameters
|
33
|
+
# @option params [String] :screen_name Screen name of user to unfollow
|
34
|
+
# @option params [String, Integer] :user_id ID of user to unfollow
|
23
35
|
# @return [Croudia::User] Unfollowed user
|
24
36
|
def unfollow(user, params={})
|
25
37
|
merge_user!(params, user)
|
@@ -29,9 +41,17 @@ module Croudia
|
|
29
41
|
|
30
42
|
# Show relationship between two users
|
31
43
|
#
|
32
|
-
# @
|
33
|
-
# @
|
34
|
-
#
|
44
|
+
# @see https://developer.croudia.com/docs/44_friendships_show
|
45
|
+
# @overload friendship(source, target, params={})
|
46
|
+
# @param [String, Integer, Croudia::User] source Source of the relationship
|
47
|
+
# @param [String, Integer, Croudia::User] target Target of the relationship
|
48
|
+
# @param [Hash] params Additional query parameters
|
49
|
+
# @overload friendship(params={})
|
50
|
+
# @param [Hash] params Query parameters
|
51
|
+
# @option params [String, Integer] :source_id ID of the source user
|
52
|
+
# @option params [String] :source_screen_name Screen name of the source user
|
53
|
+
# @option params [String, Integer] :target_id ID of the target user
|
54
|
+
# @option params [String] :target_screen_name Screen name of the target user
|
35
55
|
# @return [Croudia::Relationship]
|
36
56
|
def friendship(source, target={}, params={})
|
37
57
|
merge_user!(params, source, :source_screen_name, :source_id)
|
@@ -40,10 +60,16 @@ module Croudia
|
|
40
60
|
Croudia::Relationship.new(resp)
|
41
61
|
end
|
42
62
|
|
43
|
-
# Lookup
|
63
|
+
# Lookup friendships between the current user and others
|
44
64
|
#
|
45
|
-
# @
|
46
|
-
# @
|
65
|
+
# @see https://developer.croudia.com/docs/47_friendships_lookup
|
66
|
+
# @overload friendships(*users, params={})
|
67
|
+
# @param [String, Integer, Croudia::User] users Users to lookup friendships to them
|
68
|
+
# @param [Hash] params Additional query parameters
|
69
|
+
# @overload friendships(params={})
|
70
|
+
# @param [Hash] params Query parameters
|
71
|
+
# @option params [String] :screen_name Comma-separated screen names
|
72
|
+
# @option paramn [String] :user_id Comma-separated user IDs
|
47
73
|
# @return [Array<Croudia::User>]
|
48
74
|
def friendships(*args)
|
49
75
|
merge_users!(params = {}, args)
|
@@ -53,9 +79,17 @@ module Croudia
|
|
53
79
|
|
54
80
|
# Friend ids of specified user
|
55
81
|
#
|
56
|
-
# @
|
57
|
-
# @
|
58
|
-
#
|
82
|
+
# @see https://developer.croudia.com/docs/48_friends_ids
|
83
|
+
# @overload friend_ids(user=current_user, params={})
|
84
|
+
# @param [String, Integer, Croudia::User] user User to look up friends of
|
85
|
+
# @param [Hash] params Additional query parameters
|
86
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
87
|
+
# @overload friend_ids(params={})
|
88
|
+
# @param [Hash] params Query parameters
|
89
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
90
|
+
# @option params [String] :screen_name Screen name of the user to look up friends of
|
91
|
+
# @option params [String, Integer] :user_id ID of the user to look up friends of
|
92
|
+
# @return [Croudia::Cursor<Integer>] Cursor object that contains friend ids
|
59
93
|
def friend_ids(user=current_user, params={})
|
60
94
|
merge_user!(params, user)
|
61
95
|
resp = get('/friends/ids.json', params)
|
@@ -64,9 +98,17 @@ module Croudia
|
|
64
98
|
|
65
99
|
# Follower ids of specified user
|
66
100
|
#
|
67
|
-
# @
|
68
|
-
# @
|
69
|
-
#
|
101
|
+
# @see https://developer.croudia.com/docs/49_followers_ids
|
102
|
+
# @overload follower_ids(user=current_user, params={})
|
103
|
+
# @param [String, Integer, Croudia::User] user User to look up followers of
|
104
|
+
# @param [Hash] params Additional query parameters
|
105
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
106
|
+
# @overload follower_ids(params={})
|
107
|
+
# @param [Hash] params Query parameters
|
108
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
109
|
+
# @option params [String] :screen_name Screen name of the user to look up followers of
|
110
|
+
# @option params [String, Integer] :user_id ID of the user to look up followers of
|
111
|
+
# @return [Croudia::Cursor<Integer>] Cursor object that contains follower ids
|
70
112
|
def follower_ids(user=current_user, params={})
|
71
113
|
merge_user!(params, user)
|
72
114
|
resp = get('/followers/ids.json', params)
|
@@ -75,9 +117,19 @@ module Croudia
|
|
75
117
|
|
76
118
|
# Friends of specified user
|
77
119
|
#
|
78
|
-
# @
|
79
|
-
# @
|
80
|
-
#
|
120
|
+
# @see https://developer.croudia.com/docs/40_friends_list
|
121
|
+
# @overload friends(user=current_user, params={})
|
122
|
+
# @param [String, Integer, Croudia::User] user User to look up friends of
|
123
|
+
# @param [Hash] params Additional query parameters
|
124
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
125
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
126
|
+
# @overload friends(params={})
|
127
|
+
# @param [Hash] params Query parameters
|
128
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
129
|
+
# @option params [String] :screen_name Screen name of the user to look up friends of
|
130
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
131
|
+
# @option params [String, Integer] :user_id ID of the user to look up friends of
|
132
|
+
# @return [Croudia::Cursor<Croudia::User>] Cursor object that contains friends
|
81
133
|
def friends(user=current_user, params={})
|
82
134
|
merge_user!(params, user)
|
83
135
|
resp = get('/friends/list.json', params)
|
@@ -86,9 +138,19 @@ module Croudia
|
|
86
138
|
|
87
139
|
# Followers of specified user
|
88
140
|
#
|
89
|
-
# @
|
90
|
-
# @
|
91
|
-
#
|
141
|
+
# @see https://developer.croudia.com/docs/43_followers_list
|
142
|
+
# @overload followers(user=current_user, params={})
|
143
|
+
# @param [String, Integer, Croudia::User] user User to look up followers of
|
144
|
+
# @param [Hash] params Additional query parameters
|
145
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
146
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
147
|
+
# @overload followers(params={})
|
148
|
+
# @param [Hash] params Query parameters
|
149
|
+
# @option params [String, Integer] :cursor Cursor number, -1 to get the first page
|
150
|
+
# @option params [String] :screen_name Screen name of the user to look up followers of
|
151
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
152
|
+
# @option params [String, Integer] :user_id ID of the user to look up followers of
|
153
|
+
# @return [Croudia::Cursor<Croudia::User>] Cursor object that contains followers
|
92
154
|
def followers(user=current_user, params={})
|
93
155
|
merge_user!(params, user)
|
94
156
|
resp = get('/followers/list.json', params)
|
data/lib/croudia/api/oauth.rb
CHANGED
@@ -5,7 +5,12 @@ module Croudia
|
|
5
5
|
module OAuth
|
6
6
|
# Authorize URL
|
7
7
|
#
|
8
|
-
# @
|
8
|
+
# @see https://developer.croudia.com/docs/oauth
|
9
|
+
# @param [Hash] params Query parameters
|
10
|
+
# @option params [String] :client_id (@client_id) OAuth client ID
|
11
|
+
# @option params [String] :response_type ("code") OAuth response type
|
12
|
+
# @option params [String] :state
|
13
|
+
# @return [String] Authorize URL
|
9
14
|
def authorize_url(params={})
|
10
15
|
params[:client_id] ||= @client_id
|
11
16
|
params[:response_type] ||= 'code'
|
@@ -14,9 +19,20 @@ module Croudia
|
|
14
19
|
|
15
20
|
# Retrieve access_token
|
16
21
|
#
|
17
|
-
# @
|
18
|
-
# @
|
19
|
-
#
|
22
|
+
# @see https://developer.croudia.com/docs/oauth
|
23
|
+
# @overload get_access_token(code, params={})
|
24
|
+
# @param [String] code Authorize code passed from user
|
25
|
+
# @param [Hash] params Additional query parameters
|
26
|
+
# @option params [String] :client_id (@client_id) OAuth client ID
|
27
|
+
# @option params [String] :client_secret (@client_secret) OAuth client secret
|
28
|
+
# @option params [String] :grant_type ("authorization_code") OAuth grant type
|
29
|
+
# @overload get_access_token(params={})
|
30
|
+
# @param [Hash] params Query parameters
|
31
|
+
# @option params [String] :client_id (@client_id) OAuth client ID
|
32
|
+
# @option params [String] :client_secret (@client_secret) OAuth client secret
|
33
|
+
# @option params [String] :code Code param passed from user
|
34
|
+
# @option params [String] :grant_type ("authorization_code") OAuth grant type
|
35
|
+
# @return [Croudia::AccessToken] Access token
|
20
36
|
def get_access_token(code, params={})
|
21
37
|
case code
|
22
38
|
when String, Integer
|
data/lib/croudia/api/search.rb
CHANGED
@@ -6,8 +6,23 @@ module Croudia
|
|
6
6
|
module Search
|
7
7
|
# Search for statuses
|
8
8
|
#
|
9
|
-
# @
|
10
|
-
# @
|
9
|
+
# @see https://developer.croudia.com/docs/81_search
|
10
|
+
# @overload search(q, params={})
|
11
|
+
# @param [String] q Search query
|
12
|
+
# @param [Hash] params Additional query parameters
|
13
|
+
# @option params [String, Integer] :count Number of statuses in the response
|
14
|
+
# @option params [String] :include_entities Set false to exclude entities
|
15
|
+
# @option params [String, Integer] :max_id Paging parameter
|
16
|
+
# @option params [String, Integer] :since_id Paging parameter
|
17
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
18
|
+
# @overload search(params={})
|
19
|
+
# @param [Hash] params Query parameters
|
20
|
+
# @option params [String] :q Search query
|
21
|
+
# @option params [String, Integer] :count Number of statuses in the response
|
22
|
+
# @option params [String] :include_entities Set false to exclude entities
|
23
|
+
# @option params [String, Integer] :max_id Paging parameter
|
24
|
+
# @option params [String, Integer] :since_id Paging parameter
|
25
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
11
26
|
# @return [Croudia::SearchResults]
|
12
27
|
def search(q, params={})
|
13
28
|
merge_query!(params, q)
|
@@ -17,14 +32,28 @@ module Croudia
|
|
17
32
|
|
18
33
|
# Search for users
|
19
34
|
#
|
20
|
-
# @
|
21
|
-
# @
|
22
|
-
#
|
35
|
+
# @see https://developer.croudia.com/docs/82_users_search
|
36
|
+
# @overload search_user(q, params={})
|
37
|
+
# @param [String] q Search query
|
38
|
+
# @param [Hash] params Additional query parameters
|
39
|
+
# @option params [String, Integer] :count Number of users in the response
|
40
|
+
# @option params [String] :include_entities Set false to exclude entities
|
41
|
+
# @option params [String, Integer] :max_id Paging parameter
|
42
|
+
# @option params [String, Integer] :since_id Paging parameter
|
43
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
44
|
+
# @overload search_user(params={})
|
45
|
+
# @param [Hash] params Query parameters
|
46
|
+
# @option params [String] :q Search query
|
47
|
+
# @option params [String, Integer] :count Number of users in the response
|
48
|
+
# @option params [String, Integer] :page Page to fetch, up to 1000
|
49
|
+
# @option params [String] :trim_user Set true to return compact user objects
|
50
|
+
# @return [Array<Croudia::User>] Users found
|
23
51
|
def search_user(q, params={})
|
24
52
|
merge_query!(params, q)
|
25
53
|
resp = get('/users/search.json', params)
|
26
54
|
objects(Croudia::User, resp)
|
27
55
|
end
|
56
|
+
alias search_users search_user
|
28
57
|
end
|
29
58
|
end
|
30
59
|
end
|
@@ -5,8 +5,12 @@ module Croudia
|
|
5
5
|
module SecretMails
|
6
6
|
# Get incoming secret mails
|
7
7
|
#
|
8
|
-
# @
|
9
|
-
# @
|
8
|
+
# @see https://developer.croudia.com/docs/21_secret_mails
|
9
|
+
# @param [Hash] params Additional query parameters
|
10
|
+
# @option params [String, Integer] :count Number of secret mails in the response
|
11
|
+
# @option params [String, Integer] :max_id Paging parameter
|
12
|
+
# @option params [String, Integer] :since_id Paging parameter
|
13
|
+
# @return [Array<Croudia::SecretMail>]
|
10
14
|
def secret_mails(params={})
|
11
15
|
resp = get('/secret_mails.json', params)
|
12
16
|
objects(Croudia::SecretMail, resp)
|
@@ -14,7 +18,11 @@ module Croudia
|
|
14
18
|
|
15
19
|
# Get outgoing secret mails
|
16
20
|
#
|
17
|
-
# @
|
21
|
+
# @see https://developer.croudia.com/docs/22_secret_mails_sent
|
22
|
+
# @param [Hash] params Additional query parameters
|
23
|
+
# @option params [String, Integer] :count Number of secret mails in the response
|
24
|
+
# @option params [String, Integer] :max_id Paging parameter
|
25
|
+
# @option params [String, Integer] :since_id Paging parameter
|
18
26
|
# @return [Array<Croudia::SecretMail>]
|
19
27
|
def secret_mails_sent(params={})
|
20
28
|
resp = get('/secret_mails/sent.json', params)
|
@@ -23,9 +31,17 @@ module Croudia
|
|
23
31
|
|
24
32
|
# Send a new secret mail
|
25
33
|
#
|
26
|
-
# @
|
27
|
-
# @
|
28
|
-
#
|
34
|
+
# @see https://developer.croudia.com/docs/23_secret_mails_new
|
35
|
+
# @overload send_secret_mail(text, to_user, params={})
|
36
|
+
# @param [String] text Message body
|
37
|
+
# @param [String, Integer, Croudia::User] to_user Recipient user
|
38
|
+
# @param [Hash] params Additional query parameters
|
39
|
+
# @overload send_secret_mail(params={})
|
40
|
+
# @param [Hash] params Query parameters
|
41
|
+
# @option params [String] :screen_name Screen name of the recipient
|
42
|
+
# @option params [String] :text Message body
|
43
|
+
# @option params [String, Integer] :user_id ID of the recipient
|
44
|
+
# @return [Croudia::SecretMail] Sent message
|
29
45
|
def send_secret_mail(text, to_user={}, params={})
|
30
46
|
merge_text!(params, text, :text)
|
31
47
|
merge_user!(params, to_user)
|
@@ -36,9 +52,10 @@ module Croudia
|
|
36
52
|
|
37
53
|
# Destroy a secret mail
|
38
54
|
#
|
39
|
-
# @
|
40
|
-
# @param
|
41
|
-
# @
|
55
|
+
# @see https://developer.croudia.com/docs/24_secret_mails_destroy
|
56
|
+
# @param [String, Integer, Croudia::SecretMail] id ID of the secret mail to delete
|
57
|
+
# @param [Hash] params Additional query params
|
58
|
+
# @return [Croudia::SecretMail] Deleted secret mail
|
42
59
|
def destroy_secret_mail(id, params={})
|
43
60
|
resp = post("/secret_mails/destroy/#{get_id(id)}.json", params)
|
44
61
|
Croudia::SecretMail.new(resp)
|
@@ -46,8 +63,9 @@ module Croudia
|
|
46
63
|
|
47
64
|
# Get a secret mail
|
48
65
|
#
|
49
|
-
# @
|
50
|
-
# @param
|
66
|
+
# @see https://developer.croudia.com/docs/25_secret_mails_show
|
67
|
+
# @param [String, Integer, Croudia::SecretMail] id ID of the secret mail to get
|
68
|
+
# @param [Hash] params Additional query parameters
|
51
69
|
# @return [Croudia::SecretMail]
|
52
70
|
def show_secret_mail(id, params={})
|
53
71
|
resp = get("/secret_mails/show/#{get_id(id)}.json", params)
|