Class: SyncIssues::Comparison
- Inherits:
-
Object
- Object
- SyncIssues::Comparison
- Defined in:
- lib/sync_issues/comparison.rb
Overview
Comparison represents differences between Issues (local and GitHub)
Instance Attribute Summary collapse
-
#assignees ⇒ Object
readonly
Returns the value of attribute assignees.
-
#changed ⇒ Object
readonly
Returns the value of attribute changed.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#initialize(issue, github_issue, reset_labels: false, sync_assignees: true, sync_labels: true) ⇒ Comparison
constructor
A new instance of Comparison.
Constructor Details
#initialize(issue, github_issue, reset_labels: false, sync_assignees: true, sync_labels: true) ⇒ Comparison
Returns a new instance of Comparison.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/sync_issues/comparison.rb', line 8 def initialize(issue, github_issue, reset_labels: false, sync_assignees: true, sync_labels: true) @changed = [] @assignees = github_issue.assignees.map do |assignee| assignee.login end.sort @content = github_issue.body @labels = github_issue.labels.map { |label| label[:name] } @title = github_issue.title compare(issue, reset_labels, sync_assignees, sync_labels) end |
Instance Attribute Details
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
6 7 8 |
# File 'lib/sync_issues/comparison.rb', line 6 def assignees @assignees end |
#changed ⇒ Object (readonly)
Returns the value of attribute changed.
6 7 8 |
# File 'lib/sync_issues/comparison.rb', line 6 def changed @changed end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/sync_issues/comparison.rb', line 6 def content @content end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
6 7 8 |
# File 'lib/sync_issues/comparison.rb', line 6 def labels @labels end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/sync_issues/comparison.rb', line 6 def title @title end |
Instance Method Details
#changed? ⇒ Boolean
20 21 22 |
# File 'lib/sync_issues/comparison.rb', line 20 def changed? !@changed.empty? end |