Class: Breadcrumbs::Keys
- Inherits:
-
Object
- Object
- Breadcrumbs::Keys
- Defined in:
- lib/redis-breadcrumbs/keys.rb
Instance Method Summary collapse
- #[](key_template) ⇒ Object
- #[]=(key_template, key) ⇒ Object
- #clean_cmds ⇒ Object
-
#initialize(keys = {}) ⇒ Keys
constructor
A new instance of Keys.
- #reset_cmds ⇒ Object
- #specialize(object) ⇒ Object
Constructor Details
#initialize(keys = {}) ⇒ Keys
Returns a new instance of Keys.
7 8 9 |
# File 'lib/redis-breadcrumbs/keys.rb', line 7 def initialize keys={} @keys = keys end |
Instance Method Details
#[](key_template) ⇒ Object
11 12 13 |
# File 'lib/redis-breadcrumbs/keys.rb', line 11 def [] key_template @keys[key_template] end |
#[]=(key_template, key) ⇒ Object
15 16 17 |
# File 'lib/redis-breadcrumbs/keys.rb', line 15 def []= key_template, key @keys[key_template] = key end |
#clean_cmds ⇒ Object
25 26 27 |
# File 'lib/redis-breadcrumbs/keys.rb', line 25 def clean_cmds @keys.values.map &:clean_cmd end |
#reset_cmds ⇒ Object
29 30 31 |
# File 'lib/redis-breadcrumbs/keys.rb', line 29 def reset_cmds @keys.values.map(&:reset_cmd).compact end |