Class: SQLRecord::Base
- Inherits:
-
Object
- Object
- SQLRecord::Base
- Extended by:
- Attributes::Mapper, SanitizedQuery
- Defined in:
- lib/sql_record/base.rb
Overview
TODO:
Does it sound like the database abstraction could be a whole other class?
Base provides a class that has a collection of raw_attributes. These can be set from a database abstraction (SQLRecord::SanitizedQuery), and are expected to be type_cast by a mixin
(SQLRecord::Attributes::Mapper)
Instance Attribute Summary collapse
-
#raw_attributes ⇒ Object
readonly
the raw attributes returned from a db query.
Attributes included from Attributes::Mapper
Instance Method Summary collapse
-
#initialize(raw_attributes = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from SanitizedQuery
Methods included from Attributes::Mapper
Constructor Details
#initialize(raw_attributes = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/sql_record/base.rb', line 14 def initialize raw_attributes = {} @raw_attributes = raw_attributes end |
Instance Attribute Details
#raw_attributes ⇒ Object (readonly)
the raw attributes returned from a db query
12 13 14 |
# File 'lib/sql_record/base.rb', line 12 def raw_attributes @raw_attributes end |