Class: ActiveRecord::Aggregations::AggregationReflection
- Inherits:
-
Object
- Object
- ActiveRecord::Aggregations::AggregationReflection
- Defined in:
- lib/reactive_record/active_record/aggregations.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#klass_name ⇒ Object
readonly
Returns the value of attribute klass_name.
Instance Method Summary collapse
-
#initialize(owner_class, macro, name, options = {}) ⇒ AggregationReflection
constructor
A new instance of AggregationReflection.
- #klass ⇒ Object
Constructor Details
#initialize(owner_class, macro, name, options = {}) ⇒ AggregationReflection
Returns a new instance of AggregationReflection.
22 23 24 25 26 27 |
# File 'lib/reactive_record/active_record/aggregations.rb', line 22 def initialize(owner_class, macro, name, = {}) owner_class.reflect_on_all_aggregations << self @owner_class = owner_class @klass_name = [:class_name] || name.camelize @attribute = name end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
20 21 22 |
# File 'lib/reactive_record/active_record/aggregations.rb', line 20 def attribute @attribute end |
#klass_name ⇒ Object (readonly)
Returns the value of attribute klass_name.
19 20 21 |
# File 'lib/reactive_record/active_record/aggregations.rb', line 19 def klass_name @klass_name end |
Instance Method Details
#klass ⇒ Object
29 30 31 |
# File 'lib/reactive_record/active_record/aggregations.rb', line 29 def klass @klass ||= Object.const_get(@klass_name) end |