Class: ActiveDelegate::Association::Methods
- Inherits:
-
Object
- Object
- ActiveDelegate::Association::Methods
- Defined in:
- lib/active_delegate/association/methods.rb
Overview
Generates association method names
Instance Attribute Summary collapse
-
#association_class ⇒ Object
readonly
Returns the value of attribute association_class.
-
#association_name ⇒ Object
readonly
Returns the value of attribute association_name.
Instance Method Summary collapse
- #delegatable ⇒ Object
-
#initialize(association_name, association_class) ⇒ Methods
constructor
A new instance of Methods.
Constructor Details
#initialize(association_name, association_class) ⇒ Methods
Returns a new instance of Methods.
9 10 11 12 |
# File 'lib/active_delegate/association/methods.rb', line 9 def initialize(association_name, association_class) @association_name = association_name @association_class = association_class end |
Instance Attribute Details
#association_class ⇒ Object (readonly)
Returns the value of attribute association_class.
7 8 9 |
# File 'lib/active_delegate/association/methods.rb', line 7 def association_class @association_class end |
#association_name ⇒ Object (readonly)
Returns the value of attribute association_name.
7 8 9 |
# File 'lib/active_delegate/association/methods.rb', line 7 def association_name @association_name end |
Instance Method Details
#delegatable ⇒ Object
14 15 16 17 |
# File 'lib/active_delegate/association/methods.rb', line 14 def delegatable delegatable = suffixed + prefixed delegatable & association_class.instance_methods end |