module FollowSystem::Follower
Follower
module
This module defines follower behavior in follow system
Public Instance Methods
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
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
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
Specifies if self can follow {Followee} objects
@return [Boolean]
# File lib/follow_system/follower.rb, line 33 def is_follower? true end
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
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