Class: Gitlab::GithubImport::Importer::IssueEventImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/github_import/importer/issue_event_importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(issue_event, project, client) ⇒ IssueEventImporter

issue_event - An instance of ‘Gitlab::GithubImport::Representation::IssueEvent`. project - An instance of `Project`. client - An instance of `Gitlab::GithubImport::Client`.



12
13
14
15
16
# File 'lib/gitlab/github_import/importer/issue_event_importer.rb', line 12

def initialize(issue_event, project, client)
  @issue_event = issue_event
  @project = project
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/gitlab/github_import/importer/issue_event_importer.rb', line 7

def client
  @client
end

#issue_eventObject (readonly)

Returns the value of attribute issue_event.



7
8
9
# File 'lib/gitlab/github_import/importer/issue_event_importer.rb', line 7

def issue_event
  @issue_event
end

#projectObject (readonly)

Returns the value of attribute project.



7
8
9
# File 'lib/gitlab/github_import/importer/issue_event_importer.rb', line 7

def project
  @project
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gitlab/github_import/importer/issue_event_importer.rb', line 18

def execute
  importer = event_importer_class(issue_event)
  if importer
    importer.new(project, client).execute(issue_event)
  else
    Gitlab::GithubImport::Logger.debug(
      message: 'UNSUPPORTED_EVENT_TYPE',
      event_type: issue_event.event, event_github_id: issue_event.id
    )
  end
end