Module: ChatWork::Client::RoomMethods
- Included in:
- ChatWork::Client
- Defined in:
- lib/chatwork/client/room_methods.rb
Instance Method Summary collapse
-
#create_room(description: nil, icon_preset: nil, members_admin_ids:, members_member_ids: nil, members_readonly_ids: nil, name:, link: nil, link_code: nil, link_need_acceptance: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new group chat.
-
#destroy_room(room_id:, action_type:) {|response_body, response_header| ... } ⇒ Object
Leave/Delete a group chat.
-
#find_room(room_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get chat name, icon, and Type (my, direct, or group).
-
#get_rooms {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of all chats on your account.
-
#update_room(room_id:, description: nil, icon_preset: nil, name: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the title and icon type of the specified chat.
Instance Method Details
#create_room(description: nil, icon_preset: nil, members_admin_ids:, members_member_ids: nil, members_readonly_ids: nil, name:, link: nil, link_code: nil, link_need_acceptance: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Create a new group chat
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/chatwork/client/room_methods.rb', line 64 def create_room(description: nil, icon_preset: nil, members_admin_ids:, members_member_ids: nil, members_readonly_ids: nil, name:, link: nil, link_code: nil, link_need_acceptance: nil, &block) params = { description: description, icon_preset: icon_preset, members_admin_ids: Array(members_admin_ids).join(","), name: name, link: boolean_to_integer(link), link_need_acceptance: boolean_to_integer(link_need_acceptance), link_code: link_code, } params[:members_member_ids] = Array(members_member_ids).join(",") if members_member_ids params[:members_readonly_ids] = Array(members_readonly_ids).join(",") if members_readonly_ids post("/rooms", params, &block) end |
#destroy_room(room_id:, action_type:) {|response_body, response_header| ... } ⇒ Object
Leave/Delete a group chat
153 154 155 |
# File 'lib/chatwork/client/room_methods.rb', line 153 def destroy_room(room_id:, action_type:, &block) delete("/rooms/#{room_id}", action_type: action_type, &block) end |
#find_room(room_id:) {|response_body, response_header| ... } ⇒ Hashie::Mash
Get chat name, icon, and Type (my, direct, or group)
113 114 115 |
# File 'lib/chatwork/client/room_methods.rb', line 113 def find_room(room_id:, &block) get("/rooms/#{room_id}", &block) end |
#get_rooms {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>
Get the list of all chats on your account
31 32 33 |
# File 'lib/chatwork/client/room_methods.rb', line 31 def get_rooms(&block) get("/rooms", &block) end |
#update_room(room_id:, description: nil, icon_preset: nil, name: nil) {|response_body, response_header| ... } ⇒ Hashie::Mash
Change the title and icon type of the specified chat
138 139 140 |
# File 'lib/chatwork/client/room_methods.rb', line 138 def update_room(room_id:, description: nil, icon_preset: nil, name: nil, &block) put("/rooms/#{room_id}", description: description, icon_preset: icon_preset, name: name, &block) end |