Class: JiraDependencyVisualizer::Jira
- Inherits:
-
Object
- Object
- JiraDependencyVisualizer::Jira
- Defined in:
- lib/jira_dependency_visualizer/jira.rb
Overview
Creates a Jira client and exposes functions to get Jira issues
Instance Method Summary collapse
-
#base_url ⇒ String
The base Jira URL without a trailing slash.
-
#get_issue(issue, client = @client) ⇒ JIRA::Issue
The matched Jira issue object.
-
#initialize(opts = {}) ⇒ Jira
constructor
A new instance of Jira.
-
#query(query, client = @client) ⇒ Array[JIRA::Issue]
List of matching Jira issue objects.
Constructor Details
#initialize(opts = {}) ⇒ Jira
Returns a new instance of Jira.
19 20 21 22 |
# File 'lib/jira_dependency_visualizer/jira.rb', line 19 def initialize(opts = {}) @options = opts client end |
Instance Method Details
#base_url ⇒ String
Returns the base Jira URL without a trailing slash.
39 40 41 42 43 44 45 46 47 |
# File 'lib/jira_dependency_visualizer/jira.rb', line 39 def base_url site = @options[:site].dup context_path = @options[:context_path].dup site.chop! if site.ends_with?('/') context_path.chop! if context_path.ends_with?('/') URI.join(site, context_path).to_s end |
#get_issue(issue, client = @client) ⇒ JIRA::Issue
Returns the matched Jira issue object.
27 28 29 |
# File 'lib/jira_dependency_visualizer/jira.rb', line 27 def get_issue(issue, client = @client) client.Issue.find(issue) end |
#query(query, client = @client) ⇒ Array[JIRA::Issue]
Returns list of matching Jira issue objects.
34 35 36 |
# File 'lib/jira_dependency_visualizer/jira.rb', line 34 def query(query, client = @client) client.Issue.jql(query) end |