Class: Action::Project::DeactivateHook

Inherits:
Object
  • Object
show all
Includes:
ActivateHook::HookConfig, SetProjectAndBranch, InchCI::Action
Defined in:
app/services/action/project/deactivate_hook.rb

Constant Summary

Constants included from ActivateHook::HookConfig

ActivateHook::HookConfig::HOOK_URL

Instance Method Summary collapse

Methods included from ActivateHook::HookConfig

#hook_activate_options, #hook_create_options, #hook_deactivate_options, #hook_service, #hook_url_config

Methods included from SetProjectAndBranch

#set_project_and_branch

Methods included from InchCI::Action

#exposures, included

Constructor Details

#initialize(user, params) ⇒ DeactivateHook

Returns a new instance of DeactivateHook.


11
12
13
14
15
16
17
18
# File 'app/services/action/project/deactivate_hook.rb', line 11

def initialize(user, params)
  set_project_and_branch(params)
  if user_access_token = user.github_access_token
    process_via_github(@project.to_model, user_access_token)
  else
    raise "Need access token!"
  end
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'app/services/action/project/deactivate_hook.rb', line 20

def success?
  !@success.nil?
end