class Rusen::Notifiers::IONotifier

Constants

STDOUT

Public Class Methods

identification_symbol() click to toggle source
# File lib/rusen/notifiers/io_notifier.rb, line 10
def self.identification_symbol
  :io
end
new(settings, output = STDOUT) click to toggle source
Calls superclass method Rusen::Notifiers::BaseNotifier::new
# File lib/rusen/notifiers/io_notifier.rb, line 14
def initialize(settings, output = STDOUT)
  super(settings)
  @output   = output
end

Public Instance Methods

notify(notification) click to toggle source
# File lib/rusen/notifiers/io_notifier.rb, line 19
def notify(notification)
  @notification = notification
  @sessions     = get_sessions(@notification)

  # We need to ignore all the exceptions thrown by IONotifier#notify.
  @output.puts build_content
rescue Exception => exception
  handle_notification_exception(exception)
end

Private Instance Methods

build_content() click to toggle source
# File lib/rusen/notifiers/io_notifier.rb, line 31
def build_content
  template_path = File.expand_path('../../templates/io_template.txt.erb', __FILE__)

  template = File.open(template_path).read
  rhtml = ERB.new(template, nil, '-')
  rhtml.result(binding)
end