Class: Integrity::Notifier::Yammer

Inherits:
Notifier::Base
  • Object
show all
Defined in:
lib/notifier/yammer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build, config = {}) ⇒ Yammer

Returns a new instance of Yammer.



11
12
13
14
# File 'lib/notifier/yammer.rb', line 11

def initialize(build, config = {})
  @yammer_client = ::Yammer::Client.new(:config => config['oauth_yml']) 
  super
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/notifier/yammer.rb', line 9

def config
  @config
end

Class Method Details

.to_hamlObject



16
17
18
# File 'lib/notifier/yammer.rb', line 16

def self.to_haml
  File.read File.dirname(__FILE__) / "config.haml"
end

Instance Method Details

#deliver!Object



20
21
22
# File 'lib/notifier/yammer.rb', line 20

def deliver!
  @yammer_client.message(:post, :body => message)
end

#messageObject



24
25
26
# File 'lib/notifier/yammer.rb', line 24

def message
  @message ||= "#{build.project.name} #{short_message}"
end