Class: Lazylead::Issue
- Inherits:
-
Object
- Object
- Lazylead::Issue
- Defined in:
- lib/lazylead/system/jira.rb
Overview
An issue from Jira
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Method Summary collapse
- #assignee ⇒ Object
- #comments ⇒ Object
- #duedate ⇒ Object
- #fields ⇒ Object
- #history ⇒ Object
- #id ⇒ Object
-
#initialize(issue) ⇒ Issue
constructor
A new instance of Issue.
- #inspect ⇒ Object
- #key ⇒ Object
- #priority ⇒ Object
- #reporter ⇒ Object
- #summary ⇒ Object
- #to_s ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(issue) ⇒ Issue
Returns a new instance of Issue.
139 140 141 |
# File 'lib/lazylead/system/jira.rb', line 139 def initialize(issue) @issue = issue end |
Instance Method Details
#assignee ⇒ Object
171 172 173 |
# File 'lib/lazylead/system/jira.rb', line 171 def assignee Lazylead::User.new(@issue.assignee.attrs) end |
#comments ⇒ Object
185 186 187 |
# File 'lib/lazylead/system/jira.rb', line 185 def comments @issue.comments end |
#duedate ⇒ Object
159 160 161 |
# File 'lib/lazylead/system/jira.rb', line 159 def duedate @issue.fields["duedate"] end |
#fields ⇒ Object
175 176 177 |
# File 'lib/lazylead/system/jira.rb', line 175 def fields @issue.fields end |
#history ⇒ Object
179 180 181 182 183 |
# File 'lib/lazylead/system/jira.rb', line 179 def history return [] unless @issue.respond_to? :changelog return [] if @issue.changelog == nil? || @issue.changelog.empty? @issue.changelog["histories"] end |
#id ⇒ Object
143 144 145 |
# File 'lib/lazylead/system/jira.rb', line 143 def id @issue.id end |
#inspect ⇒ Object
193 194 195 |
# File 'lib/lazylead/system/jira.rb', line 193 def inspect to_s end |
#key ⇒ Object
147 148 149 |
# File 'lib/lazylead/system/jira.rb', line 147 def key @issue.key end |
#priority ⇒ Object
163 164 165 |
# File 'lib/lazylead/system/jira.rb', line 163 def priority fields["priority"]["name"] end |
#reporter ⇒ Object
167 168 169 |
# File 'lib/lazylead/system/jira.rb', line 167 def reporter Lazylead::User.new(fields["reporter"]) end |
#summary ⇒ Object
151 152 153 |
# File 'lib/lazylead/system/jira.rb', line 151 def summary fields["summary"] end |
#to_s ⇒ Object
189 190 191 |
# File 'lib/lazylead/system/jira.rb', line 189 def to_s "#{key} #{summary}" end |
#url ⇒ Object
155 156 157 |
# File 'lib/lazylead/system/jira.rb', line 155 def url @issue.attrs["self"].split("/rest/api/").first + "/browse/" + key end |