Class: Dataset::Record::Meta
- Inherits:
-
Object
- Object
- Dataset::Record::Meta
- Defined in:
- lib/dataset/record/meta.rb
Overview
A mechanism to cache information about an ActiveRecord class to speed things up a bit for insertions, finds, and method generation.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
:nodoc:.
-
#heirarchy ⇒ Object
readonly
:nodoc:.
-
#record_class ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
- #inheriting_record? ⇒ Boolean
-
#initialize(heirarchy, record_class) ⇒ Meta
constructor
A new instance of Meta.
- #to_s ⇒ Object
Constructor Details
#initialize(heirarchy, record_class) ⇒ Meta
Returns a new instance of Meta.
14 15 16 17 18 |
# File 'lib/dataset/record/meta.rb', line 14 def initialize(heirarchy, record_class) @heirarchy = heirarchy @record_class = record_class @class_name = record_class.name end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
:nodoc:
7 8 9 |
# File 'lib/dataset/record/meta.rb', line 7 def class_name @class_name end |
#heirarchy ⇒ Object (readonly)
:nodoc:
7 8 9 |
# File 'lib/dataset/record/meta.rb', line 7 def heirarchy @heirarchy end |
#record_class ⇒ Object (readonly)
:nodoc:
7 8 9 |
# File 'lib/dataset/record/meta.rb', line 7 def record_class @record_class end |
Instance Method Details
#inheriting_record? ⇒ Boolean
20 21 22 |
# File 'lib/dataset/record/meta.rb', line 20 def inheriting_record? !record_class.descends_from_active_record? end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/dataset/record/meta.rb', line 24 def to_s "#<RecordMeta: #{table_name}>" end |