Class: FayeTracking::NamespacedKeyList

Inherits:
AbstractKeyList show all
Defined in:
lib/faye_tracking/namespaced_key_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(ns, key_list) ⇒ NamespacedKeyList

Returns a new instance of NamespacedKeyList.

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
# File 'lib/faye_tracking/namespaced_key_list.rb', line 3

def initialize(ns, key_list)
  raise ArgumentError, 'namespace param cannot be blank' \
    if ns.nil? || ns.empty?

  @ns       = ns
  @key_list = key_list
end

Instance Method Details

#add(key, value) ⇒ Object



11
12
13
# File 'lib/faye_tracking/namespaced_key_list.rb', line 11

def add(key, value)
  @key_list.add build_key(key), value
end

#empty?(key) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/faye_tracking/namespaced_key_list.rb', line 27

def empty?(key)
  @key_list.empty? build_key(key)
end

#member?(key, value) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/faye_tracking/namespaced_key_list.rb', line 19

def member?(key, value)
  @key_list.member? build_key(key), value
end

#members(key) ⇒ Object



23
24
25
# File 'lib/faye_tracking/namespaced_key_list.rb', line 23

def members(key)
  @key_list.members build_key(key)
end

#remove(key, value) ⇒ Object



15
16
17
# File 'lib/faye_tracking/namespaced_key_list.rb', line 15

def remove(key, value)
  @key_list.remove build_key(key), value
end

#remove_all(key) ⇒ Object



31
32
33
# File 'lib/faye_tracking/namespaced_key_list.rb', line 31

def remove_all(key)
  @key_list.remove_all build_key(key)
end