Module: Socialization::Stores::Mixins::Base

Instance Method Summary collapse

Instance Method Details

#touch_actor?(actor) ⇒ Boolean



10
11
12
13
# File 'lib/socialization/stores/mixins/base.rb', line 10

def touch_actor?(actor)
  return false unless actor.respond_to?(:touch)
  touch == :all || touch.to_s =~ /er$/i
end

#touch_dependents(actor, victim) ⇒ Object



5
6
7
8
# File 'lib/socialization/stores/mixins/base.rb', line 5

def touch_dependents(actor, victim)
  actor.touch if touch_actor?(actor)
  victim.touch if touch_victim?(victim)
end

#touch_victim?(victim) ⇒ Boolean



15
16
17
18
# File 'lib/socialization/stores/mixins/base.rb', line 15

def touch_victim?(victim)
  return false unless victim.respond_to?(:touch)
  touch == :all || touch.to_s =~ /able$/i
end