Class: ActivePStore::Base

Inherits:
Object
  • Object
show all
Extended by:
ConnectionHandling, DynamicMatchers, FinderMethods, Inheritance, QueryMethods, Querying
Includes:
Core, Persistence
Defined in:
lib/active_pstore/base.rb

Instance Attribute Summary

Attributes included from Persistence

#id

Class Method Summary collapse

Methods included from ConnectionHandling

establish_connection, use_connection

Methods included from DynamicMatchers

respond_to?

Methods included from FinderMethods

find, find_by, find_by!, first, last, take

Methods included from Inheritance

new

Methods included from Querying

count, destroy_all, emtpy?, update_all

Methods included from QueryMethods

where

Methods included from Persistence

#destroy, #new_record?, #save, #update_attribute, #update_attributes

Methods included from Core

#==, #hash

Class Method Details

.allObject



13
14
15
16
17
# File 'lib/active_pstore/base.rb', line 13

def all
  use_connection do |connection|
    ActivePStore::Collection.new(connection[self.pstore_key] || [])
  end
end

.pstore_keyObject



19
20
21
# File 'lib/active_pstore/base.rb', line 19

def pstore_key
  self.to_s
end