Class: Feedbook::Notifiers::IRCNotifier
- Inherits:
-
Object
- Object
- Feedbook::Notifiers::IRCNotifier
- Includes:
- Singleton
- Defined in:
- lib/feedbook/notifiers/irc_notifier.rb
Instance Method Summary collapse
-
#load_configuration(configuration = {}) ⇒ NilClass
Load configuration for IRCNotifier.
-
#notify(message) ⇒ NilClass
Sends notification to IRC.
Instance Method Details
#load_configuration(configuration = {}) ⇒ NilClass
Load configuration for IRCNotifier
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/feedbook/notifiers/irc_notifier.rb', line 25 def load_configuration(configuration = {}) irc_url = configuration.fetch('url') irc_port = configuration.fetch('port') ssl_enabled = configuration.fetch('ssl_enabled') @channel = configuration.fetch('channel') @nick = configuration.fetch('nick') @client = IrcNotify::Client.build(irc_url, irc_port, ssl: ssl_enabled) puts 'Configuration loaded for IRCNotifier' end |
#notify(message) ⇒ NilClass
Sends notification to IRC
13 14 15 16 17 18 19 |
# File 'lib/feedbook/notifiers/irc_notifier.rb', line 13 def notify() client.register(nick) client.notify() client.quit puts "New message has been notified on IRC: #{}" end |