-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmy_status.rb
27 lines (27 loc) · 966 Bytes
/
my_status.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module ChatWork
module MyStatus
# Get the number of: unread messages, unread To messages, and unfinished tasks.
#
# @see http://developer.chatwork.com/ja/endpoint_my.html#GET-my-status
# @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
#
# @yield [response_body, response_header] if block was given, return response body and response header through block arguments
# @yieldparam response_body [Hashie::Mash] response body
# @yieldparam response_header [Hash<String, String>] response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)
#
# @return [Hashie::Mash]
#
# @example response format
# {
# "unread_room_num": 2,
# "mention_room_num": 1,
# "mytask_room_num": 3,
# "unread_num": 12,
# "mention_num": 1,
# "mytask_num": 8
# }
def self.get(&block)
ChatWork.client.get_my_status(&block)
end
end
end