Sha256: ab22bc1ab619aba3e7be0552d2a7749ab5802c069b6b6ca6ae6e0283a20b09cd

Contents?: true

Size: 709 Bytes

Versions: 6

Compression:

Stored size: 709 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

6 entries across 6 versions & 1 rubygems

Version Path
follow_system-0.1.1 lib/follow_system.rb
follow_system-0.1.0 lib/follow_system.rb
follow_system-0.0.9 lib/follow_system.rb
follow_system-0.0.8 lib/follow_system.rb
follow_system-0.0.7 lib/follow_system.rb
follow_system-0.0.6 lib/follow_system.rb