Class: Gitlab::GithubImport::IssueFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/gitlab/github_import/issue_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#formatter, #project, #raw_data

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

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

Instance Method Details

#attributesObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gitlab/github_import/issue_formatter.rb', line 4

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

#has_comments?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'lib/gitlab/github_import/issue_formatter.rb', line 19

def has_comments?
  raw_data.comments > 0
end

#numberObject


23
24
25
# File 'lib/gitlab/github_import/issue_formatter.rb', line 23

def number
  raw_data.number
end

#valid?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/gitlab/github_import/issue_formatter.rb', line 27

def valid?
  raw_data.pull_request.nil?
end