Class: ActiveDelegate::Attribute::Methods
- Inherits:
-
Object
- Object
- ActiveDelegate::Attribute::Methods
- Defined in:
- lib/active_delegate/attribute/methods.rb
Overview
Generates attribute method names
Instance Attribute Summary collapse
-
#association_instance ⇒ Object
readonly
Returns the value of attribute association_instance.
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
Instance Method Summary collapse
- #accessors ⇒ Object
- #delegatable ⇒ Object
- #dirty ⇒ Object
-
#initialize(attribute_name, association_class, writer:, dirty:) ⇒ Methods
constructor
A new instance of Methods.
Constructor Details
#initialize(attribute_name, association_class, writer:, dirty:) ⇒ Methods
Returns a new instance of Methods.
9 10 11 12 13 14 |
# File 'lib/active_delegate/attribute/methods.rb', line 9 def initialize(attribute_name, association_class, writer:, dirty:) @define_writer = writer @define_dirty = dirty @attribute_name = attribute_name @association_instance = association_class.new end |
Instance Attribute Details
#association_instance ⇒ Object (readonly)
Returns the value of attribute association_instance.
7 8 9 |
# File 'lib/active_delegate/attribute/methods.rb', line 7 def association_instance @association_instance end |
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
7 8 9 |
# File 'lib/active_delegate/attribute/methods.rb', line 7 def attribute_name @attribute_name end |
Instance Method Details
#accessors ⇒ Object
16 17 18 |
# File 'lib/active_delegate/attribute/methods.rb', line 16 def accessors suffix_attribute(accessor_suffixes) end |
#delegatable ⇒ Object
24 25 26 |
# File 'lib/active_delegate/attribute/methods.rb', line 24 def delegatable accessors + dirty end |
#dirty ⇒ Object
20 21 22 |
# File 'lib/active_delegate/attribute/methods.rb', line 20 def dirty suffix_attribute(dirty_suffixes) end |