module FollowSystem::Followee

Followee module

This module defines followee behavior in follow system

Public Instance Methods

followed_by?(follower) click to toggle source

Specifies if self is followed by a {Follower} object

@param [Follower] follower - the {Follower} object to test against @return [Boolean]

# File lib/follow_system/followee.rb, line 43
def followed_by?(follower)
  Follow.follows?(follower, self)
end
followers_by(klass) click to toggle source

Retrieves a scope of {Follow} objects that follows self filtered {Follower} type

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

# File lib/follow_system/followee.rb, line 53
def followers_by(klass)
  Follow.scope_by_followee(self).scope_by_follower_type(klass)
end
is_followee?() click to toggle source

Specifies if self can be followed by {Follower} objects

@return [Boolean]

# File lib/follow_system/followee.rb, line 33
def is_followee?
  true
end