Class: Midnight::Rails::CommitHooker

Inherits:
Object
  • Object
show all
Defined in:
lib/midnight/rails/commit_hooker.rb

Overview

Instance Method Summary collapse

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/midnight/rails/commit_hooker.rb', line 18

def respond_to_missing?(_method_name, _include_private = false)
  true
end