class Caracal::Core::Models::BookmarkModel

This class encapsulates the logic needed to store and manipulate bookmarks.

Attributes

bookmark_id[R]
bookmark_name[R]
bookmark_start[R]

accessors

Public Instance Methods

run_attributes() click to toggle source

.run_attributes

# File lib/caracal/core/models/bookmark_model.rb, line 30
def run_attributes
  {
    start:          bookmark_start,
    id:             bookmark_id,
    name:           bookmark_name
  }
end
start?() click to toggle source
STATE HELPERS =========================
# File lib/caracal/core/models/bookmark_model.rb, line 58
def start?
  !!bookmark_start
end
valid?() click to toggle source
VALIDATION ============================
# File lib/caracal/core/models/bookmark_model.rb, line 65
def valid?
  a  = [:id]
  a << :name  if start?

  a.map { |m| send("bookmark_#{ m }") }.compact.size == a.size
end

Private Instance Methods

option_keys() click to toggle source
# File lib/caracal/core/models/bookmark_model.rb, line 78
def option_keys
  [:id, :name, :start]
end