Class: Lazylead::Comments
- Inherits:
-
Object
- Object
- Lazylead::Comments
- Defined in:
- lib/lazylead/system/jira.rb
Overview
The jira issue comments
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Attribute Summary collapse
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
Instance Method Summary collapse
- #body?(text) ⇒ Boolean
- #comments ⇒ Object
-
#initialize(issue, sys) ⇒ Comments
constructor
A new instance of Comments.
- #last(quantity) ⇒ Object
Constructor Details
#initialize(issue, sys) ⇒ Comments
Returns a new instance of Comments.
280 281 282 283 |
# File 'lib/lazylead/system/jira.rb', line 280 def initialize(issue, sys) @issue = issue @sys = sys end |
Instance Attribute Details
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
278 279 280 |
# File 'lib/lazylead/system/jira.rb', line 278 def issue @issue end |
Instance Method Details
#body?(text) ⇒ Boolean
285 286 287 |
# File 'lib/lazylead/system/jira.rb', line 285 def body?(text) comments.any? { |c| c.attrs["body"].include? text } end |
#comments ⇒ Object
289 290 291 292 293 294 |
# File 'lib/lazylead/system/jira.rb', line 289 def comments @comments ||= @sys.raw do |conn| conn.Issue.find(@issue.id, expand: "comments,changelog", fields: "") .comments end end |
#last(quantity) ⇒ Object
296 297 298 |
# File 'lib/lazylead/system/jira.rb', line 296 def last(quantity) comments.last(quantity).map { |c| c.attrs["body"] } end |