Module: Socialization::Stores::Mixins::Follow

Included in:
ActiveRecordStores::Follow, RedisStores::Follow
Defined in:
lib/socialization/stores/mixins/follow.rb

Instance Method Summary collapse

Instance Method Details

#after_follow(method) ⇒ Object



16
17
18
19
# File 'lib/socialization/stores/mixins/follow.rb', line 16

def after_follow(method)
  raise Socialization::ArgumentError unless method.is_a?(Symbol) || method.nil?
  @after_create_hook = method
end

#after_unfollow(method) ⇒ Object



21
22
23
24
# File 'lib/socialization/stores/mixins/follow.rb', line 21

def after_unfollow(method)
  raise Socialization::ArgumentError unless method.is_a?(Symbol) || method.nil?
  @after_destroy_hook = method
end

#touch(what = nil) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/socialization/stores/mixins/follow.rb', line 7

def touch(what = nil)
  if what.nil?
    @touch || false
  else
    raise Socialization::ArgumentError unless [:all, :follower, :followable, false, nil].include?(what)
    @touch = what
  end
end