Class: CampfireNotifier

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/campfire_notifier.rb

Class Method Summary collapse

Class Method Details

.configObject



13
14
15
# File 'lib/campfire_notifier.rb', line 13

def self.config
  @config ||= YAML.load_file(File.expand_path("~/.campfire_notifier.yml"))
end

.speak(message) ⇒ Object



17
18
19
20
21
# File 'lib/campfire_notifier.rb', line 17

def self.speak(message)
  base_uri    "http://#{config['subdomain']}.campfirenow.com"
  basic_auth  config["token"], 'x'
  post "/room/#{config['room_id']}/speak.json", :body => { :message => { :body => message, :type => 'Textmessage' } }.to_json
end