Class: FayeTracking::NamespacedKeyList
- Inherits:
-
AbstractKeyList
- Object
- AbstractKeyList
- FayeTracking::NamespacedKeyList
- Defined in:
- lib/faye_tracking/namespaced_key_list.rb
Instance Method Summary collapse
- #add(key, value) ⇒ Object
- #empty?(key) ⇒ Boolean
-
#initialize(ns, key_list) ⇒ NamespacedKeyList
constructor
A new instance of NamespacedKeyList.
- #member?(key, value) ⇒ Boolean
- #members(key) ⇒ Object
- #remove(key, value) ⇒ Object
- #remove_all(key) ⇒ Object
Constructor Details
#initialize(ns, key_list) ⇒ NamespacedKeyList
Returns a new instance of NamespacedKeyList.
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
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
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 |