Class: Gitlab::LegacyGithubImport::IssueFormatter

Inherits:
IssuableFormatter show all
Defined in:
lib/gitlab/legacy_github_import/issue_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#client, #formatter, #project, #raw_data

Instance Method Summary collapse

Methods inherited from IssuableFormatter

#find_condition

Methods inherited from BaseFormatter

#create!, #initialize, #url

Constructor Details

This class inherits a constructor from Gitlab::LegacyGithubImport::BaseFormatter

Instance Method Details

#attributesObject


6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/legacy_github_import/issue_formatter.rb', line 6

def attributes
  {
    iid: number,
    project: project,
    milestone: milestone,
    title: raw_data.title,
    description: description,
    state: state,
    author_id: author_id,
    assignee_ids: Array(assignee_id),
    created_at: raw_data.created_at,
    updated_at: raw_data.updated_at
  }
end

#has_comments?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/gitlab/legacy_github_import/issue_formatter.rb', line 21

def has_comments?
  raw_data.comments > 0
end

#project_associationObject


25
26
27
# File 'lib/gitlab/legacy_github_import/issue_formatter.rb', line 25

def project_association
  :issues
end

#pull_request?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/gitlab/legacy_github_import/issue_formatter.rb', line 29

def pull_request?
  raw_data.pull_request.present?
end