Class: RademadeAdmin::Model::Reflection
- Inherits:
-
Object
- Object
- RademadeAdmin::Model::Reflection
- Defined in:
- lib/rademade_admin/model/reflection.rb
Constant Summary collapse
- ORM_TYPE_ACTIVERECORD =
'ActiveRecord'- ORM_TYPE_MONGOID =
'Mongoid'
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#data_adapter ⇒ RademadeAdmin::Model::Adapter::Data
Load data adapter for current model.
-
#initialize(model, controller) ⇒ Reflection
constructor
A new instance of Reflection.
-
#query_adapter ⇒ RademadeAdmin::Model::Adapter::Query
Load query adapter for current model.
Constructor Details
#initialize(model, controller) ⇒ Reflection
Returns a new instance of Reflection.
8 9 10 |
# File 'lib/rademade_admin/model/reflection.rb', line 8 def initialize(model, controller) @model, @controller = model, controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/rademade_admin/model/reflection.rb', line 6 def controller @controller end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/rademade_admin/model/reflection.rb', line 6 def model @model end |
Instance Method Details
#data_adapter ⇒ RademadeAdmin::Model::Adapter::Data
Load data adapter for current model
18 19 20 |
# File 'lib/rademade_admin/model/reflection.rb', line 18 def data_adapter @data_adapter ||= "RademadeAdmin::Model::Adapter::Data::#{orm_type}".constantize.new(@model) end |
#query_adapter ⇒ RademadeAdmin::Model::Adapter::Query
Load query adapter for current model
25 26 27 |
# File 'lib/rademade_admin/model/reflection.rb', line 25 def query_adapter @query_adapter ||= "RademadeAdmin::Model::Adapter::Query::#{orm_type}".constantize.new(@model) end |