Class: Envoy::Campfire
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#room ⇒ Object
Returns the value of attribute room.
-
#token ⇒ Object
Returns the value of attribute token.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
Attributes inherited from Transport
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Campfire
constructor
A new instance of Campfire.
- #send_message(message) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Campfire
Returns a new instance of Campfire.
40 41 42 43 44 45 |
# File 'lib/envoy/transport.rb', line 40 def initialize( = {}) self.account = [:account] self.room = [:room] self.token = [:token] self.use_ssl = [:use_ssl] end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
38 39 40 |
# File 'lib/envoy/transport.rb', line 38 def account @account end |
#room ⇒ Object
Returns the value of attribute room.
38 39 40 |
# File 'lib/envoy/transport.rb', line 38 def room @room end |
#token ⇒ Object
Returns the value of attribute token.
38 39 40 |
# File 'lib/envoy/transport.rb', line 38 def token @token end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
38 39 40 |
# File 'lib/envoy/transport.rb', line 38 def use_ssl @use_ssl end |
Instance Method Details
#send_message(message) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/envoy/transport.rb', line 47 def () Broach.settings = { 'account' => @account, 'token' => @token, 'use_ssl' => @use_ssl } Broach.speak(self.room, .body || .subject) return true rescue Broach::APIError => error self.errors << SendError.new(error, Time.now) return false end |