Class: Oort::Callbacks
- Inherits:
-
Object
- Object
- Oort::Callbacks
- Defined in:
- lib/oort/callbacks.rb
Instance Attribute Summary collapse
-
#association_class ⇒ Object
readonly
Returns the value of attribute association_class.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#insert_method_name ⇒ Object
readonly
Returns the value of attribute insert_method_name.
-
#instance_name ⇒ Object
readonly
Returns the value of attribute instance_name.
-
#remove_from_method_name ⇒ Object
readonly
Returns the value of attribute remove_from_method_name.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(association_class:, remove_from_method_name:, insert_method_name:, instance_name:, default:) ⇒ Callbacks
constructor
A new instance of Callbacks.
Constructor Details
#initialize(association_class:, remove_from_method_name:, insert_method_name:, instance_name:, default:) ⇒ Callbacks
17 18 19 20 21 22 23 |
# File 'lib/oort/callbacks.rb', line 17 def initialize(association_class:, remove_from_method_name:, insert_method_name:, instance_name:, default:) @association_class = association_class @remove_from_method_name = remove_from_method_name @insert_method_name = insert_method_name @instance_name = instance_name @default = default end |
Instance Attribute Details
#association_class ⇒ Object (readonly)
Returns the value of attribute association_class.
15 16 17 |
# File 'lib/oort/callbacks.rb', line 15 def association_class @association_class end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
15 16 17 |
# File 'lib/oort/callbacks.rb', line 15 def default @default end |
#insert_method_name ⇒ Object (readonly)
Returns the value of attribute insert_method_name.
15 16 17 |
# File 'lib/oort/callbacks.rb', line 15 def insert_method_name @insert_method_name end |
#instance_name ⇒ Object (readonly)
Returns the value of attribute instance_name.
15 16 17 |
# File 'lib/oort/callbacks.rb', line 15 def instance_name @instance_name end |
#remove_from_method_name ⇒ Object (readonly)
Returns the value of attribute remove_from_method_name.
15 16 17 |
# File 'lib/oort/callbacks.rb', line 15 def remove_from_method_name @remove_from_method_name end |
Class Method Details
.call(association_class:, remove_from_method_name:, insert_method_name:, instance_name:, default:) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/oort/callbacks.rb', line 5 def self.call(association_class:, remove_from_method_name:, insert_method_name:, instance_name:, default:) new( association_class: association_class, remove_from_method_name: remove_from_method_name, insert_method_name: insert_method_name, instance_name: instance_name, default: default ).call end |
Instance Method Details
#call ⇒ Object
25 26 27 28 |
# File 'lib/oort/callbacks.rb', line 25 def call add_callbacks add_methods end |