Class: Jira::Requests::Base

Inherits:
Object
  • Object
show all
Includes:
ProjectServicesLoggable
Defined in:
app/services/jira/requests/base.rb

Direct Known Subclasses

Projects::ListService

Constant Summary collapse

JIRA_API_VERSION =
2

Instance Method Summary collapse

Methods included from ProjectServicesLoggable

#build_message, #log_error, #log_info, #logger

Constructor Details

#initialize(jira_service, params = {}) ⇒ Base

Returns a new instance of Base.


10
11
12
13
# File 'app/services/jira/requests/base.rb', line 10

def initialize(jira_service, params = {})
  @project = jira_service&.project
  @jira_service = jira_service
end

Instance Method Details

#base_api_urlObject


21
22
23
# File 'app/services/jira/requests/base.rb', line 21

def base_api_url
  "/rest/api/#{api_version}"
end

#executeObject


15
16
17
18
19
# File 'app/services/jira/requests/base.rb', line 15

def execute
  return ServiceResponse.error(message: _('Jira service not configured.')) unless jira_service&.active?

  request
end