Module: BookmarkSystem::Bookmarkee
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/bookmark_system/bookmarkee.rb
Overview
Bookmarkee module
This module defines bookmarkee behavior in bookmark system
Instance Method Summary collapse
-
#bookmarked_by?(bookmarker) ⇒ Boolean
Specifies if self is bookmarked by a Bookmarker object.
-
#bookmarkers_by(klass) ⇒ ActiveRecord::Relation
Retrieves a scope of Bookmark objects that bookmarks self filtered Bookmarker type.
-
#is_bookmarkee? ⇒ Boolean
Specifies if self can be bookmarked by Bookmarker objects.
Instance Method Details
#bookmarked_by?(bookmarker) ⇒ Boolean
Specifies if self is bookmarked by a BookmarkSystem::Bookmarker object
43 44 45 |
# File 'lib/bookmark_system/bookmarkee.rb', line 43 def bookmarked_by?(bookmarker) Bookmark.bookmarks?(bookmarker, self) end |
#bookmarkers_by(klass) ⇒ ActiveRecord::Relation
Retrieves a scope of BookmarkSystem::Bookmark objects that bookmarks self filtered BookmarkSystem::Bookmarker type
53 54 55 |
# 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? ⇒ Boolean
Specifies if self can be bookmarked by BookmarkSystem::Bookmarker objects
33 34 35 |
# File 'lib/bookmark_system/bookmarkee.rb', line 33 def is_bookmarkee? true end |