Class: SyncIssues::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/sync_issues/comparison.rb

Overview

Comparison represents differences between Issues (local and GitHub)

Instance Attribute Summary collapse

Instance Method Summary collapse

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.
  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

#assigneesObject (readonly)

Returns the value of attribute assignees.



6
7
8
# File 'lib/sync_issues/comparison.rb', line 6

def assignees
  @assignees
end

#changedObject (readonly)

Returns the value of attribute changed.



6
7
8
# File 'lib/sync_issues/comparison.rb', line 6

def changed
  @changed
end

#contentObject (readonly)

Returns the value of attribute content.



6
7
8
# File 'lib/sync_issues/comparison.rb', line 6

def content
  @content
end

#labelsObject (readonly)

Returns the value of attribute labels.



6
7
8
# File 'lib/sync_issues/comparison.rb', line 6

def labels
  @labels
end

#titleObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/sync_issues/comparison.rb', line 20

def changed?
  !@changed.empty?
end