Class: Janky::ChatService::Flowdock
- Inherits:
-
Object
- Object
- Janky::ChatService::Flowdock
- Defined in:
- lib/janky-flowdock.rb,
lib/janky-flowdock/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
-
#initialize(settings) ⇒ Flowdock
constructor
A new instance of Flowdock.
- #rooms ⇒ Object
- #speak(message, room_id, options = {}) ⇒ Object
Constructor Details
#initialize(settings) ⇒ Flowdock
Returns a new instance of Flowdock.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/janky-flowdock.rb', line 7 def initialize(settings) token = settings["JANKY_CHAT_FLOWDOCK_TOKEN"] if token.nil? || token.empty? raise Error, "JANKY_CHAT_FLOWDOCK_TOKEN setting is required" end from_name = settings["JANKY_CHAT_FLOWDOCK_FROM_NAME"] || "CI" from_email = settings["JANKY_CHAT_FLOWDOCK_FROM_EMAIL"] source = settings["JANKY_CHAT_FLOWDOCK_SOURCE"] || "Janky" @client = ::Flowdock::Flow.new(api_token: token, source: source, from: {name: from_name, address: from_email}) end |
Instance Method Details
#rooms ⇒ Object
25 26 27 |
# File 'lib/janky-flowdock.rb', line 25 def rooms [] end |
#speak(message, room_id, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/janky-flowdock.rb', line 20 def speak(, room_id, = {}) subject = "CI build status" @client.push_to_team_inbox(content: , subject: subject, tags: ["ci"]) end |