Class: Apadmi::Grout::Issue
- Inherits:
-
Struct
- Object
- Struct
- Apadmi::Grout::Issue
- Defined in:
- lib/apadmi/grout/models/issue.rb
Overview
A generic issue type wrapping up the underlying JIRA & ADO object
Instance Attribute Summary collapse
-
#issue_type ⇒ Object
Returns the value of attribute issue_type.
-
#key ⇒ Object
Returns the value of attribute key.
-
#raw_object ⇒ Object
Returns the value of attribute raw_object.
-
#status ⇒ Object
Returns the value of attribute status.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .from_ado_hash(hash) ⇒ Apadmi::Grout::Issue
- .from_ado_hashes(hashes) ⇒ Array<Apadmi::Grout::Issue>
- .from_jira_issue(issue, base_url) ⇒ Apadmi::Grout::Issue
- .from_jira_issues(issues, base_url) ⇒ Array<Apadmi::Grout::Issue>
Instance Attribute Details
#issue_type ⇒ Object
Returns the value of attribute issue_type
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def issue_type @issue_type end |
#key ⇒ Object
Returns the value of attribute key
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def key @key end |
#raw_object ⇒ Object
Returns the value of attribute raw_object
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def raw_object @raw_object end |
#status ⇒ Object
Returns the value of attribute status
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def status @status end |
#summary ⇒ Object
Returns the value of attribute summary
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url
12 13 14 |
# File 'lib/apadmi/grout/models/issue.rb', line 12 def url @url end |
Class Method Details
.from_ado_hash(hash) ⇒ Apadmi::Grout::Issue
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/apadmi/grout/models/issue.rb', line 14 def self.from_ado_hash(hash) Issue.new( hash["id"].to_s, hash["fields"]["System.Title"], hash["fields"]["System.State"], hash["fields"]["System.WorkItemType"], hash["url"], hash ) end |
.from_ado_hashes(hashes) ⇒ Array<Apadmi::Grout::Issue>
26 27 28 |
# File 'lib/apadmi/grout/models/issue.rb', line 26 def self.from_ado_hashes(hashes) hashes.map { |h| Issue.from_ado_hash(h) } end |
.from_jira_issue(issue, base_url) ⇒ Apadmi::Grout::Issue
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/apadmi/grout/models/issue.rb', line 32 def self.from_jira_issue(issue, base_url) Issue.new( issue.key, issue.summary, issue.status.name, issue.issuetype.name, "#{base_url}/browse/#{issue.key}", issue ) end |
.from_jira_issues(issues, base_url) ⇒ Array<Apadmi::Grout::Issue>
44 45 46 |
# File 'lib/apadmi/grout/models/issue.rb', line 44 def self.from_jira_issues(issues, base_url) issues.map { |i| Issue.from_jira_issue(i, base_url) } end |