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

Instance Method Details

#autojoin!Array<String>

Send JOIN for each in #autojoin_channels

Returns:

  • (Array<String>)

    channels joined



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_channelsArray<String>

The channels to join. By default, returns an empty array.

Returns:

  • (Array<String>)

    channel names



21
22
23
# File 'lib/iirc/modules/autojoin.rb', line 21

def autojoin_channels
  []
end

#configure_autojoinObject (private)



7
8
9
# File 'lib/iirc/modules/autojoin.rb', line 7

private def configure_autojoin
  on :'001', :autojoin!
end