class Volt::Persistors::Page

Public Instance Methods

auto_generate_id() click to toggle source
# File lib/volt/models/persistors/page.rb, line 6
def auto_generate_id
  true
end
where(query) click to toggle source
# File lib/volt/models/persistors/page.rb, line 10
def where(query)
  @model.select do |model|
    # Run through each key in the query and make sure the value matches.
    # We use .all? because once one fails to match, we can return false,
    # because it wouldn't match as a whole.
    query.all? do |key, value|
      model.get(key) == value
    end
  end
end