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

Instance Method Summary collapse

Instance Method Details

#touch_actor?(actor) ⇒ Boolean

Returns:

  • (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, subject) ⇒ Object



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

def touch_dependents(actor, subject)
  actor.touch if touch_actor?(actor)
  subject.touch if touch_subject?(subject)
end

#touch_subject?(subject) ⇒ Boolean Also known as: touch_victim?

Returns:

  • (Boolean)


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

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