Class: SQLRecord::Base

Inherits:
Object
  • Object
show all
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

Attributes included from Attributes::Mapper

#sql_select_columns

Instance Method Summary collapse

Methods included from SanitizedQuery

find, query

Methods included from Attributes::Mapper

column, with_class, with_opts

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_attributesObject (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