Class: Esse::ActiveRecord::Callback
- Inherits:
-
Object
- Object
- Esse::ActiveRecord::Callback
- Defined in:
- lib/esse/active_record/callbacks.rb
Direct Known Subclasses
Esse::ActiveRecord::Callbacks::IndexingOnCreate, Esse::ActiveRecord::Callbacks::IndexingOnDestroy, Esse::ActiveRecord::Callbacks::IndexingOnUpdate, Esse::ActiveRecord::Callbacks::UpdateLazyAttribute
Instance Attribute Summary collapse
-
#block_result ⇒ Object
readonly
Returns the value of attribute block_result.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #call(model) ⇒ Object
-
#initialize(repo:, block_result: nil, with: nil, **kwargs) ⇒ Callback
constructor
A new instance of Callback.
Constructor Details
#initialize(repo:, block_result: nil, with: nil, **kwargs) ⇒ Callback
Returns a new instance of Callback.
8 9 10 11 12 13 |
# File 'lib/esse/active_record/callbacks.rb', line 8 def initialize(repo:, block_result: nil, with: nil, **kwargs) @repo = repo @with = with @options = kwargs @block_result = block_result end |
Instance Attribute Details
#block_result ⇒ Object (readonly)
Returns the value of attribute block_result.
6 7 8 |
# File 'lib/esse/active_record/callbacks.rb', line 6 def block_result @block_result end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/esse/active_record/callbacks.rb', line 6 def @options end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/esse/active_record/callbacks.rb', line 6 def repo @repo end |
Instance Method Details
#call(model) ⇒ Object
15 16 17 |
# File 'lib/esse/active_record/callbacks.rb', line 15 def call(model) raise NotImplementedError, 'You must implement #call method' end |