Class: Volt::Persistors::Page

Inherits:
Base show all
Defined in:
lib/volt/models/persistors/page.rb

Instance Method Summary collapse

Methods inherited from Base

#added, #async?, #changed, #clear, #event_added, #event_removed, #initialize, #loaded, #removed, #root_model

Constructor Details

This class inherits a constructor from Volt::Persistors::Base

Instance Method Details

#auto_generate_idObject



6
7
8
# File 'lib/volt/models/persistors/page.rb', line 6

def auto_generate_id
  true
end

#where(query) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/volt/models/persistors/page.rb', line 10

def where(query)
  @model.select do |model|
    # Filter through each part of the query and make sure it matches.
    query.each_pair do |key, value|
      next false unless model.get(key) == value
    end

    true
  end
end