Class: Breadcrumbs::MemberOfSetKey
- Defined in:
- lib/redis-breadcrumbs/member_of_set_key.rb
Instance Method Summary collapse
- #clean_cmd ⇒ Object
-
#initialize(member_template, set_template, clean_method, options) ⇒ MemberOfSetKey
constructor
A new instance of MemberOfSetKey.
- #key_name ⇒ Object
- #reset_cmd ⇒ Object
- #specialize(object) ⇒ Object
Methods inherited from Key
Constructor Details
#initialize(member_template, set_template, clean_method, options) ⇒ MemberOfSetKey
Returns a new instance of MemberOfSetKey.
3 4 5 6 7 8 9 |
# File 'lib/redis-breadcrumbs/member_of_set_key.rb', line 3 def initialize member_template, set_template, clean_method, @options = || {} @member_template = member_template @set_template = set_template @clean_method = clean_method @resetable = [:reset] end |
Instance Method Details
#clean_cmd ⇒ Object
20 21 22 |
# File 'lib/redis-breadcrumbs/member_of_set_key.rb', line 20 def clean_cmd [@clean_method, @set_template, @member_template] end |
#key_name ⇒ Object
28 29 30 |
# File 'lib/redis-breadcrumbs/member_of_set_key.rb', line 28 def key_name @set_template end |
#reset_cmd ⇒ Object
24 25 26 |
# File 'lib/redis-breadcrumbs/member_of_set_key.rb', line 24 def reset_cmd clean_cmd if @resetable end |
#specialize(object) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/redis-breadcrumbs/member_of_set_key.rb', line 11 def specialize object MemberOfSetKey.new( specialize_from_template(@member_template, object), specialize_from_template(@set_template, object), @clean_method, @options ) end |