Class: Snitch::Services::Campfire

Inherits:
Snitch::Service show all
Defined in:
lib/snitch/services/campfire.rb

Overview

Allows for using tinder the unnofficial campfire api to paste a commit message into a campfire chatroom.

Instance Attribute Summary

Attributes inherited from Snitch::Service

#attributes, #base

Instance Method Summary collapse

Methods inherited from Snitch::Service

#initialize, #method_missing, new_from_name

Constructor Details

This class inherits a constructor from Snitch::Service

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Snitch::Service

Instance Method Details

#connection(force = false) ⇒ Object

Logs into campfire and enters the room in the config file.



11
12
13
14
15
16
17
18
19
# File 'lib/snitch/services/campfire.rb', line 11

def connection(force=false)
  if @campfire.nil? || force
    connection = ::Tinder::Campfire.new(subdomain)
    connection.(, password)
    raise ServiceLoginError, "Login to Campfire failed" unless connection.logged_in?
    @campfire = connection.find_or_create_room_by_name(room)
  end
  @campfire
end

#tattle(message) ⇒ Object

Pastes a given message into a campfire room using the connection method.



22
23
24
# File 'lib/snitch/services/campfire.rb', line 22

def tattle(message)
  connection.paste(message)
end