Class: Kindling::Campfire
- Inherits:
-
Object
- Object
- Kindling::Campfire
- Defined in:
- lib/kindling/campfire.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
Instance Method Summary collapse
- #credentials ⇒ Object
-
#initialize(api_token, subdomain, ssl = false) ⇒ Campfire
constructor
A new instance of Campfire.
- #rooms ⇒ Object
- #speak(room, message, type = "Textmessage") ⇒ Object
Constructor Details
#initialize(api_token, subdomain, ssl = false) ⇒ Campfire
Returns a new instance of Campfire.
7 8 9 10 11 |
# File 'lib/kindling/campfire.rb', line 7 def initialize(api_token, subdomain, ssl=false) @api_token = api_token @subdomain = subdomain @ssl = ssl end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
5 6 7 |
# File 'lib/kindling/campfire.rb', line 5 def api_token @api_token end |
#ssl ⇒ Object
Returns the value of attribute ssl.
5 6 7 |
# File 'lib/kindling/campfire.rb', line 5 def ssl @ssl end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
5 6 7 |
# File 'lib/kindling/campfire.rb', line 5 def subdomain @subdomain end |
Instance Method Details
#credentials ⇒ Object
25 26 27 |
# File 'lib/kindling/campfire.rb', line 25 def credentials {:username => @api_token, :password => 'x'} end |
#rooms ⇒ Object
13 14 15 |
# File 'lib/kindling/campfire.rb', line 13 def rooms Kindling::Request.rooms(self) end |
#speak(room, message, type = "Textmessage") ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/kindling/campfire.rb', line 17 def speak(room, , type="Textmessage") if is_campfire_id?(room) Kindling::Request.speak(, self, room, type) else Kindling::Request.speak(, self, map_room_name(room), type) end end |