Class: CeilingCat::Campfire::Connection
- Inherits:
-
CeilingCat::Connection
- Object
- CeilingCat::Connection
- CeilingCat::Campfire::Connection
- Defined in:
- lib/ceiling_cat/services/campfire/connection.rb
Instance Attribute Summary
Attributes inherited from CeilingCat::Connection
Instance Method Summary collapse
- #campfire ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
- #total_user_count ⇒ Object
Methods inherited from CeilingCat::Connection
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 |
# File 'lib/ceiling_cat/services/campfire/connection.rb', line 6 def initialize(config) super @config.ssl ||= "true" end |
Instance Method Details
#campfire ⇒ Object
11 12 13 |
# File 'lib/ceiling_cat/services/campfire/connection.rb', line 11 def campfire @campfire = Tinder::Campfire.new(self.config.subdomain, :token => self.config.token, :ssl => self.config.ssl) end |
#total_user_count ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ceiling_cat/services/campfire/connection.rb', line 15 def total_user_count users = 0 @campfire.rooms.each do |room| users += room.users.size end users end |