Sha256: 47ba400abd88f471e3778999d983ec564557fed882e4cff3b98556eb9a06e2e4

Contents?: true

Size: 708 Bytes

Versions: 1

Compression:

Stored size: 708 Bytes

Contents

require 'follow_system/follow'
require 'follow_system/followee'
require 'follow_system/follower'

###
# FollowSystem module
#
# This module defines common behavior in follow system
###
module FollowSystem
  ###
  # Specifies if self can be followed by {Follower} objects
  #
  # @return [Boolean]
  ###
  def is_followee?
    false
  end

  ###
  # Specifies if self can follow {Followee} objects
  #
  # @return [Boolean]
  ###
  def is_follower?
    false
  end

  ###
  # Instructs self to act as followee
  ###
  def act_as_followee
    include Followee
  end

  ###
  # Instructs self to act as follower
  ###
  def act_as_follower
    include Follower
  end
end

ActiveRecord::Base.extend FollowSystem

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
follow_system-0.2.0 lib/follow_system.rb