module BookmarkSystem::Bookmarkee
Bookmarkee
module
This module defines bookmarkee behavior in bookmark system
Public Instance Methods
bookmarked_by?(bookmarker)
click to toggle source
Specifies if self is bookmarked by a {Bookmarker} object
@param [Bookmarker] bookmarker - the {Bookmarker} object to test against @return [Boolean]
# File lib/bookmark_system/bookmarkee.rb, line 43 def bookmarked_by?(bookmarker) Bookmark.bookmarks?(bookmarker, self) end
bookmarkers_by(klass)
click to toggle source
Retrieves a scope of {Bookmark} objects that bookmarks self filtered {Bookmarker} type
@param [Class] klass - the {Class} to filter @return [ActiveRecord::Relation]
# File lib/bookmark_system/bookmarkee.rb, line 53 def bookmarkers_by(klass) Bookmark.scope_by_bookmarkee(self).scope_by_bookmarker_type(klass) end
is_bookmarkee?()
click to toggle source
Specifies if self can be bookmarked by {Bookmarker} objects
@return [Boolean]
# File lib/bookmark_system/bookmarkee.rb, line 33 def is_bookmarkee? true end