Class: ODB::Database
Class Attribute Summary collapse
-
.current ⇒ Object
Returns the value of attribute current.
Instance Attribute Summary collapse
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize(store) ⇒ Database
constructor
A new instance of Database.
- #transaction(&block) ⇒ Object
Constructor Details
#initialize(store) ⇒ Database
Returns a new instance of Database.
19 20 21 22 23 |
# File 'lib/odb.rb', line 19 def initialize(store) self.store = store self.store.db = self self.class.current = self unless self.class.current end |
Class Attribute Details
.current ⇒ Object
Returns the value of attribute current.
16 17 18 |
# File 'lib/odb.rb', line 16 def current @current end |
Instance Attribute Details
#store ⇒ Object
Returns the value of attribute store.
13 14 15 |
# File 'lib/odb.rb', line 13 def store @store end |
Instance Method Details
#transaction(&block) ⇒ Object
25 26 27 |
# File 'lib/odb.rb', line 25 def transaction(&block) Transaction.new(self, &block) end |