Class: QAT::Reporter::Xray::Publisher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/qat/reporter/xray/publisher/base.rb

Overview

QAT::Reporter::Xray::Publisher::Base integrator class

Direct Known Subclasses

Cloud, Hosted

Defined Under Namespace

Classes: Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Initializes Xray Publisher url and login information



16
17
18
19
20
21
# File 'lib/qat/reporter/xray/publisher/base.rb', line 16

def initialize
	@base_url                   = QAT::Reporter::Xray::Config.jira_url
	@login_credentials          = QAT::Reporter::Xray::Config.
	@cloud_xray_api_credentials = QAT::Reporter::Xray::Config.cloud_xray_api_credentials
	@default_cloud_api_url      = QAT::Reporter::Xray::Config.xray_default_api_url
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



13
14
15
# File 'lib/qat/reporter/xray/publisher/base.rb', line 13

def base_url
  @base_url
end

#cloud_xray_api_credentialsObject (readonly)

Returns the value of attribute cloud_xray_api_credentials.



13
14
15
# File 'lib/qat/reporter/xray/publisher/base.rb', line 13

def cloud_xray_api_credentials
  @cloud_xray_api_credentials
end

#default_cloud_api_urlObject (readonly)

Returns the value of attribute default_cloud_api_url.



13
14
15
# File 'lib/qat/reporter/xray/publisher/base.rb', line 13

def default_cloud_api_url
  @default_cloud_api_url
end

#default_headersObject (readonly)

Get the default headers for Xray (‘password’ in Xray API is password)



29
30
31
# File 'lib/qat/reporter/xray/publisher/base.rb', line 29

def default_headers
  @default_headers
end

#login_credentialsObject (readonly)

Returns the value of attribute login_credentials.



13
14
15
# File 'lib/qat/reporter/xray/publisher/base.rb', line 13

def 
  @login_credentials
end

Instance Method Details

#cloud_graphql_headersObject



40
41
42
# File 'lib/qat/reporter/xray/publisher/base.rb', line 40

def cloud_graphql_headers
	auth_headers
end

#create_issue(data) ⇒ Object

Creates a Jira issue



24
25
26
# File 'lib/qat/reporter/xray/publisher/base.rb', line 24

def create_issue(data)
	Client.new(base_url).post('/rest/api/2/issue', data.to_json, default_headers)
end