Module: MailToHipChat::MessageChute

Included in:
MailToHipChat::MessageChutes::Airbrake, MailToHipChat::MessageChutes::TestEmail
Defined in:
lib/mail_to_hip_chat/message_chute.rb

Overview

Helpers for building a message chute. A message chute is something that responds to #call, and returns true if it’s able to deliver the message off to HipChat. A chute can be something as simple as a Proc object. The ones this gem ship with are small classes that make use of this module.

Instance Method Summary collapse

Instance Method Details

#initialize_hipchat_opts(opts) ⇒ Object

Parameters:

  • opts (Hash)

    The options to create a message chute with

Options Hash (opts):

  • :rooms (Array, String)

    A room or an array of rooms to send messages to



11
12
13
14
# File 'lib/mail_to_hip_chat/message_chute.rb', line 11

def initialize_hipchat_opts(opts)
  @rooms       = Array(opts[:rooms])
  @hipchat_api = opts[:hipchat_api] || HipChat::API.new(opts[:api_token])
end