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

Inherits:
Object
  • Object
show all
Includes:
Logger
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



19
20
21
22
23
24
# File 'lib/qat/reporter/xray/publisher/base.rb', line 19

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

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



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

def base_url
  @base_url
end

#cloud_xray_api_credentialsObject (readonly)

Returns the value of attribute cloud_xray_api_credentials.



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

def cloud_xray_api_credentials
  @cloud_xray_api_credentials
end

#default_cloud_api_urlObject (readonly)

Returns the value of attribute default_cloud_api_url.



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

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)



33
34
35
# File 'lib/qat/reporter/xray/publisher/base.rb', line 33

def default_headers
  @default_headers
end

#login_credentialsObject (readonly)

Returns the value of attribute login_credentials.



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

def 
  @login_credentials
end

Instance Method Details

#create_issue(data) ⇒ Object

Creates a Jira issue



27
28
29
# File 'lib/qat/reporter/xray/publisher/base.rb', line 27

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