Class: Midnight::Rails::CommitHooker
- Inherits:
-
Object
- Object
- Midnight::Rails::CommitHooker
- Defined in:
- lib/midnight/rails/commit_hooker.rb
Overview
after_commit hook dev.to/evilmartians/rails-aftercommit-everywhere–4j9g
Instance Method Summary collapse
-
#initialize(&after_commit) ⇒ CommitHooker
constructor
A new instance of CommitHooker.
-
#method_missing(method_name, *_args) ⇒ Object
:nocov: rubocop:disable Style/MethodMissingSuper.
-
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissingSuper.
Constructor Details
#initialize(&after_commit) ⇒ CommitHooker
Returns a new instance of CommitHooker.
6 7 8 9 |
# File 'lib/midnight/rails/commit_hooker.rb', line 6 def initialize(&after_commit) @after_commit = after_commit freeze end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *_args) ⇒ Object
:nocov: rubocop:disable Style/MethodMissingSuper
13 14 15 |
# File 'lib/midnight/rails/commit_hooker.rb', line 13 def method_missing(method_name, *_args) after_commit.call if method_name == :committed! end |
Instance Method Details
#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean
rubocop:enable Style/MethodMissingSuper
18 19 20 |
# File 'lib/midnight/rails/commit_hooker.rb', line 18 def respond_to_missing?(_method_name, _include_private = false) true end |