Class: Gruf::Hooks::Base
- Inherits:
-
Object
- Object
- Gruf::Hooks::Base
- 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
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service, options = {}) ⇒ Base
constructor
A new instance of Base.
-
#setup ⇒ Object
Method that can be used to setup the hook prior to running it.
Methods included from Loggable
Constructor Details
#initialize(service, options = {}) ⇒ Base
Returns a new instance of Base.
31 32 33 34 35 |
# File 'lib/gruf/hooks/base.rb', line 31 def initialize(service, = {}) @service = service @options = setup end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
25 26 27 |
# File 'lib/gruf/hooks/base.rb', line 25 def @options end |
#service ⇒ Object (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
#setup ⇒ Object
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 |