module FayeTracking

Constants

VERSION

Attributes

logger[RW]
redis[W]

Public Class Methods

configure(&block) click to toggle source
# File lib/faye_tracking.rb, line 11
def configure(&block)
  block.call(self)
end
faye_extension() click to toggle source
# File lib/faye_tracking.rb, line 39
def faye_extension
  @_faye_extension ||= FayeExtension.new(tracker)
end
on_subscribe(&block) click to toggle source
# File lib/faye_tracking.rb, line 59
def on_subscribe(&block)
  on_subscribe_callbacks << block
end
on_subscribe_callbacks() click to toggle source
# File lib/faye_tracking.rb, line 55
def on_subscribe_callbacks
  @_on_subscribe_callbacks || reset_on_subscribe_callbacks
end
redis() click to toggle source
# File lib/faye_tracking.rb, line 47
def redis
  @redis || raise('redis is not set')
end
remove_from_channel(channel, client) click to toggle source
# File lib/faye_tracking.rb, line 31
def remove_from_channel(channel, client)
  tracker.remove(channel, client)
end
reset_on_subscribe_callbacks() click to toggle source
# File lib/faye_tracking.rb, line 67
def reset_on_subscribe_callbacks
  @_on_subscribe_callbacks = []
end
reset_store() click to toggle source
# File lib/faye_tracking.rb, line 35
def reset_store
  redis.keys('*').each {|k| redis.del k}
end
run_on_subscribe_callbacks(*args) click to toggle source
# File lib/faye_tracking.rb, line 63
def run_on_subscribe_callbacks(*args)
  on_subscribe_callbacks.each { |blk| blk.call(*args) }
end
tracker() click to toggle source
# File lib/faye_tracking.rb, line 51
def tracker
  @_tracker = Tracker.new(redis)
end
user_in_any_channel?(user) click to toggle source
# File lib/faye_tracking.rb, line 15
def user_in_any_channel?(user)
  !tracker.channels_for_user(user).empty?
end
user_in_channel?(user, channel) click to toggle source
# File lib/faye_tracking.rb, line 19
def user_in_channel?(user, channel)
  tracker.user_in_channel?(user, channel)
end
user_with_client_id(client_id) click to toggle source
# File lib/faye_tracking.rb, line 27
def user_with_client_id(client_id)
  tracker.user_with_client_id(client_id)
end
users_in_channel(channel) click to toggle source
# File lib/faye_tracking.rb, line 23
def users_in_channel(channel)
  tracker.users_in_channel(channel)
end