Class: Chat::JoinService
- Inherits:
-
Object
- Object
- Chat::JoinService
- Defined in:
- app/services/doodle/chat/join_service.rb
Instance Method Summary collapse
- #break_limit? ⇒ Boolean
-
#initialize(user, protocol) ⇒ JoinService
constructor
A new instance of JoinService.
- #join(channel) ⇒ Object
- #out(channel) ⇒ Object
Constructor Details
#initialize(user, protocol) ⇒ JoinService
3 4 5 6 |
# File 'app/services/doodle/chat/join_service.rb', line 3 def initialize(user, protocol) @protocol = protocol @user = user end |
Instance Method Details
#break_limit? ⇒ Boolean
14 15 16 |
# File 'app/services/doodle/chat/join_service.rb', line 14 def break_limit? @user.break_limit_concurrent_protocols? end |
#join(channel) ⇒ Object
8 9 10 11 12 |
# File 'app/services/doodle/chat/join_service.rb', line 8 def join(channel) @protocol.add_analyst_into(@user) @protocol.add_participant_into_conversation(@user.login) @user.enter_in_channel(channel) end |
#out(channel) ⇒ Object
18 19 20 21 |
# File 'app/services/doodle/chat/join_service.rb', line 18 def out(channel) @protocol.remove_participant_from_conversation(@user.login) @user.out_of_channel(channel) end |