Sha256: 0bd44404ec5587d399c2dbfd039421263d3c52749d3eb6ee152a1bb34a98acc2

Contents?: true

Size: 773 Bytes

Versions: 3

Compression:

Stored size: 773 Bytes

Contents

require 'mention_system/mention'
require 'mention_system/mention_processor'
require 'mention_system/mentionee'
require 'mention_system/mentioner'

###
# MentionSystem module
#
# This module defines common behavior in mention system
###
module MentionSystem
  ###
  # Specifies if self can be mentioned by {Mentioner} objects
  #
  # @return [Boolean]
  ###
  def is_mentionee?
    false
  end

  ###
  # Specifies if self can mention {Mentionee} objects
  #
  # @return [Boolean]
  ###
  def is_mentioner?
    false
  end

  ###
  # Instructs self to act as mentionee
  ###
  def act_as_mentionee
    include Mentionee
  end

  ###
  # Instructs self to act as mentioner
  ###
  def act_as_mentioner
    include Mentioner
  end
end

ActiveRecord::Base.extend MentionSystem

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mention_system-0.3.1 lib/mention_system.rb
mention_system-0.3.0 lib/mention_system.rb
mention_system-0.2.0 lib/mention_system.rb