Module: IIRC::AutoJoin
- Included in:
- Batteries
- Defined in:
- lib/iirc/modules/autojoin.rb
Overview
Automatically joins channels on RPL_WELCOME (001).
Override #autojoin_channels to choose which channels to join. #autojoin! may be called at any time to resend.
Instance Method Summary collapse
-
#autojoin! ⇒ Array<String>
Send JOIN for each in #autojoin_channels.
-
#autojoin_channels ⇒ Array<String>
The channels to join.
- #configure_autojoin ⇒ Object private
Instance Method Details
#autojoin! ⇒ Array<String>
Send JOIN for each in #autojoin_channels
13 14 15 16 17 |
# File 'lib/iirc/modules/autojoin.rb', line 13 def autojoin! for channel in autojoin_channels self << "JOIN #{channel}" end end |
#autojoin_channels ⇒ Array<String>
The channels to join. By default, returns an empty array.
21 22 23 |
# File 'lib/iirc/modules/autojoin.rb', line 21 def autojoin_channels [] end |
#configure_autojoin ⇒ Object (private)
7 8 9 |
# File 'lib/iirc/modules/autojoin.rb', line 7 private def configure_autojoin on :'001', :autojoin! end |