module FollowSystem::Follower

Follower module

This module defines follower behavior in follow system

Public Instance Methods

follow(followee) click to toggle source

Creates a {Follow} relationship between self and a {Followee} object

@param [Followee] followee - the followee of the {Follow} relationship @return [Boolean]

# File lib/follow_system/follower.rb, line 43
def follow(followee)
  Follow.follow(self, followee)
end
followees_by(klass) click to toggle source

Retrieves a scope of {Follow} objects that are followed by self

@param [Class] klass - the {Class} to include @return [ActiveRecord::Relation]

# File lib/follow_system/follower.rb, line 83
def followees_by(klass)
  Follow.scope_by_follower(self).scope_by_followee_type(klass)
end
follows?(followee) click to toggle source

Specifies if self follows a {Follower} object

@param [Followee] followee - the {Followee} object to test against @return [Boolean]

# File lib/follow_system/follower.rb, line 73
def follows?(followee)
  Follow.follows?(self, followee)
end
is_follower?() click to toggle source

Specifies if self can follow {Followee} objects

@return [Boolean]

# File lib/follow_system/follower.rb, line 33
def is_follower?
  true
end
toggle_follow(followee) click to toggle source

Toggles a {Follow} relationship between self and a {Followee} object

@param [Followee] followee - the followee of the {Follow} relationship @return [Boolean]

# File lib/follow_system/follower.rb, line 63
def toggle_follow(followee)
  Follow.toggle_follow(self, followee)
end
unfollow(followee) click to toggle source

Destroys a {Follow} relationship between self and a {Followee} object

@param [Followee] followee - the followee of the {Follow} relationship @return [Boolean]

# File lib/follow_system/follower.rb, line 53
def unfollow(followee)
  Follow.unfollow(self, followee)
end