Module: Whatsapp::Concerns::GroupMethods
- Included in:
- AccountProxy, Session
- Defined in:
- lib/whatsapp/concerns/group_methods.rb
Overview
Shared group management methods.
The includer must define a private +whatsapp_client+ method returning a Whatsapp::Client instance.
Instance Method Summary collapse
-
#add_group_participants(group_id, participants:) ⇒ Hash
Add participants to a group.
-
#create_group(subject:, participants:) ⇒ Group
Create a new group.
-
#group(group_id) ⇒ Group
Get detailed info about a group.
-
#groups ⇒ Array<Group>
List all groups the account participates in.
-
#remove_group_participants(group_id, participants:) ⇒ Hash
Remove participants from a group.
-
#update_group(group_id, subject: nil, description: nil) ⇒ Hash
Update a group's subject and/or description.
Instance Method Details
#add_group_participants(group_id, participants:) ⇒ Hash
Add participants to a group.
47 48 49 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 47 def add_group_participants(group_id, participants:) whatsapp_client.add_group_participants(group_id, participants: participants) end |
#create_group(subject:, participants:) ⇒ Group
Create a new group.
28 29 30 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 28 def create_group(subject:, participants:) whatsapp_client.create_group(subject: subject, participants: participants) end |
#group(group_id) ⇒ Group
Get detailed info about a group.
19 20 21 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 19 def group(group_id) whatsapp_client.group(group_id) end |
#groups ⇒ Array<Group>
List all groups the account participates in.
11 12 13 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 11 def groups whatsapp_client.groups end |
#remove_group_participants(group_id, participants:) ⇒ Hash
Remove participants from a group.
56 57 58 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 56 def remove_group_participants(group_id, participants:) whatsapp_client.remove_group_participants(group_id, participants: participants) end |
#update_group(group_id, subject: nil, description: nil) ⇒ Hash
Update a group's subject and/or description.
38 39 40 |
# File 'lib/whatsapp/concerns/group_methods.rb', line 38 def update_group(group_id, subject: nil, description: nil) whatsapp_client.update_group(group_id, subject: subject, description: description) end |