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.



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

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.



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

def config
  @config
end

Class Method Details

.to_hamlObject



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

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

Instance Method Details

#deliver!Object



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

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

#messageObject



25
26
27
28
29
30
31
# File 'lib/notifier/yammer.rb', line 25

def message
  @message ||= "\#{build.project.name}: \#{short_message} (at \#{build.commited_at} by \#{build.commit_author.name})\n Commit Message: '\#{build.commit_message}'\n Link: \#{build_url}\n"
end