Class: Gruf::Hooks::Base

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/gruf/hooks/base.rb

Overview

Base class for a hook. Define before, around, or after methods to utilize functionality.

Direct Known Subclasses

ActiveRecord::ConnectionReset

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#logger

Constructor Details

#initialize(service, options = {}) ⇒ Base

Returns a new instance of Base.

Parameters:



31
32
33
34
35
# File 'lib/gruf/hooks/base.rb', line 31

def initialize(service, options = {})
  @service = service
  @options = options
  setup
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



25
26
27
# File 'lib/gruf/hooks/base.rb', line 25

def options
  @options
end

#serviceObject (readonly)

Returns the value of attribute service.



25
26
27
# File 'lib/gruf/hooks/base.rb', line 25

def service
  @service
end

Instance Method Details

#setupObject

Method that can be used to setup the hook prior to running it



39
40
41
# File 'lib/gruf/hooks/base.rb', line 39

def setup
  # noop
end