Class: Class
Instance Method Summary collapse
-
#record_store(store = nil) ⇒ Object
Set the storage adapter for the class.
- #records ⇒ Object
Instance Method Details
#record_store(store = nil) ⇒ Object
Set the storage adapter for the class. This allows differnt classes to be stored in different databases. By default the store set in the global $norma_store is used.
56 57 58 59 |
# File 'lib/norma/orm.rb', line 56 def record_store(store=nil) @store = store if store @store ||= $norma_store end |
#records ⇒ Object
61 62 63 64 65 |
# File 'lib/norma/orm.rb', line 61 def records a = [] ObjectSpace.each_object(self) do |o| ; a << o ; end a end |