Class: DBMapping::Base
- Inherits:
-
Object
- Object
- DBMapping::Base
- Defined in:
- lib/data/sqlite/base_mapper.rb
Overview
This class serves as a parent class for the mapper classes to store common methods and attributes
Direct Known Subclasses
Instance Attribute Summary collapse
-
#db_base ⇒ DBBasic
readonly
private
The basic database adapter.
Instance Method Summary collapse
-
#check_max_id(result) ⇒ Object
private
helper method to determine the maximam id of the given database table.
-
#initialize(database) ⇒ Base
constructor
initialization.
Constructor Details
#initialize(database) ⇒ Base
initialization
9 10 11 |
# File 'lib/data/sqlite/base_mapper.rb', line 9 def initialize(database) @db_base = SqliteDatabase::DBBasic.new(database) end |
Instance Attribute Details
#db_base ⇒ DBBasic (readonly, private)
Returns the basic database adapter.
16 17 18 |
# File 'lib/data/sqlite/base_mapper.rb', line 16 def db_base @db_base end |
Instance Method Details
#check_max_id(result) ⇒ Object (private)
helper method to determine the maximam id of the given database table
20 21 22 23 24 25 26 |
# File 'lib/data/sqlite/base_mapper.rb', line 20 def check_max_id(result) if (result != nil) Integer(result["Id"]) else 0 end end |