Sha256: d65a7fd2b946b564a9f0b763f8f0d9eeae18111dec838a9dedab31a28fc0cb01

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

require 'bookmark_system/bookmark'
require 'bookmark_system/bookmarkee'
require 'bookmark_system/bookmarker'

###
# BookmarkSystem module
#
# This module defines common behavior in bookmark system
###
module BookmarkSystem
  ###
  # Specifies if self can be bookmarked by {Bookmarker} objects
  #
  # @return [Boolean]
  ###
  def is_bookmarkee?
    false
  end

  ###
  # Specifies if self can bookmark {Bookmarkee} objects
  #
  # @return [Boolean]
  ###
  def is_bookmarker?
    false
  end

  ###
  # Instructs self to act as bookmarkee
  ###
  def act_as_bookmarkee
    include Bookmarkee
  end

  ###
  # Instructs self to act as bookmarker
  ###
  def act_as_bookmarker
    include Bookmarker
  end
end

ActiveRecord::Base.extend BookmarkSystem

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bookmark_system-0.2.0 lib/bookmark_system.rb