Class: Terjira::Client::Base
Overview
Abstract class to delegate jira-ruby resource class
Direct Known Subclasses
Agile, Board, Field, Issue, Issuetype, Priority, Project, RapidView, Resolution, Sprint, Status, StatusCategory, User
Constant Summary
collapse
- DEFAULT_CACHE_SEC =
60
- DEFAULT_API_PATH =
'/rest/api/2/'.freeze
- AGILE_API_PATH =
'/rest/agile/1.0/'.freeze
Constants included
from JQLBuilder
JQLBuilder::SEARCH_KEYS, JQLBuilder::STRICT_KEYS
AuthOptionBuilder::AUTH_CACHE_KEY
Class Method Summary
collapse
Methods included from JQLBuilder
build_jql
auth_file_cache, build_auth_options, build_auth_options_by_cached, build_auth_options_by_tty, expire_auth_options
Class Method Details
.cache(options = {}) ⇒ Object
.class_name ⇒ Object
35
36
37
|
# File 'lib/terjira/client/base.rb', line 35
def class_name
to_s.split('::').last
end
|
.client ⇒ Object
18
19
20
|
# File 'lib/terjira/client/base.rb', line 18
def client
@client ||= JIRA::Client.new(build_auth_options)
end
|
.parse_body(response) ⇒ Object
68
69
70
|
# File 'lib/terjira/client/base.rb', line 68
def parse_body(response)
JSON.parse(response.body) if response.body.present?
end
|
.resource ⇒ Object
22
23
24
|
# File 'lib/terjira/client/base.rb', line 22
def resource
client.send(class_name) if client.respond_to?(class_name)
end
|
.site_url ⇒ Object
26
27
28
29
|
# File 'lib/terjira/client/base.rb', line 26
def site_url
auth_options = build_auth_options
"#{auth_options[:site]}/#{auth_options[:context_path]}"
end
|
.username ⇒ Object
31
32
33
|
# File 'lib/terjira/client/base.rb', line 31
def username
client.options[:username]
end
|