Class: Integrations::Test::BaseService
- Inherits:
-
Object
- Object
- Integrations::Test::BaseService
- Includes:
- BaseServiceUtility
- Defined in:
- app/services/integrations/test/base_service.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#event ⇒ Object
Returns the value of attribute event.
-
#integration ⇒ Object
Returns the value of attribute integration.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(integration, current_user, event = nil) ⇒ BaseService
constructor
A new instance of BaseService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(integration, current_user, event = nil) ⇒ BaseService
Returns a new instance of BaseService.
13 14 15 16 17 |
# File 'app/services/integrations/test/base_service.rb', line 13 def initialize(integration, current_user, event = nil) @integration = integration @current_user = current_user @event = event end |
Instance Attribute Details
#current_user ⇒ Object
Returns the value of attribute current_user.
8 9 10 |
# File 'app/services/integrations/test/base_service.rb', line 8 def current_user @current_user end |
#event ⇒ Object
Returns the value of attribute event.
8 9 10 |
# File 'app/services/integrations/test/base_service.rb', line 8 def event @event end |
#integration ⇒ Object
Returns the value of attribute integration.
8 9 10 |
# File 'app/services/integrations/test/base_service.rb', line 8 def integration @integration end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/services/integrations/test/base_service.rb', line 19 def execute if event && (integration.supported_events.exclude?(event) || data.blank?) return error('Testing not available for this event') end integration.test(data) rescue ArgumentError => e error(e.) end |