Class: HooksService
- Inherits:
-
Object
- Object
- HooksService
- Defined in:
- lib/wingify/services/hooks_service.rb
Instance Attribute Summary collapse
-
#decision ⇒ Object
readonly
Returns the value of attribute decision.
Instance Method Summary collapse
-
#execute(properties) ⇒ Object
Executes the callback.
-
#get ⇒ Hash
Retrieves the decision object.
-
#initialize(options) ⇒ HooksService
constructor
A new instance of HooksService.
-
#set(properties) ⇒ Object
Sets properties to the decision object.
Constructor Details
#initialize(options) ⇒ HooksService
Returns a new instance of HooksService.
21 22 23 24 25 |
# File 'lib/wingify/services/hooks_service.rb', line 21 def initialize() @callback = .dig(:integrations, :callback) @is_callback_function = is_function?(@callback) @decision = {} end |
Instance Attribute Details
#decision ⇒ Object (readonly)
Returns the value of attribute decision.
19 20 21 |
# File 'lib/wingify/services/hooks_service.rb', line 19 def decision @decision end |
Instance Method Details
#execute(properties) ⇒ Object
Executes the callback
29 30 31 |
# File 'lib/wingify/services/hooks_service.rb', line 29 def execute(properties) @callback.call(properties) if @is_callback_function end |
#get ⇒ Hash
Retrieves the decision object
41 42 43 |
# File 'lib/wingify/services/hooks_service.rb', line 41 def get @decision end |
#set(properties) ⇒ Object
Sets properties to the decision object
35 36 37 |
# File 'lib/wingify/services/hooks_service.rb', line 35 def set(properties) @decision = properties if @is_callback_function end |