Class: CeilingCat::Campfire::Connection

Inherits:
CeilingCat::Connection show all
Defined in:
lib/ceiling_cat/services/campfire/connection.rb

Instance Attribute Summary

Attributes inherited from CeilingCat::Connection

#config

Instance Method Summary collapse

Methods inherited from CeilingCat::Connection

#plugins, #storage

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

#campfireObject



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_countObject



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