Class: Gitlab::GithubImport::Importer::LfsObjectImporter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lfs_object, project, _) ⇒ LfsObjectImporter

lfs_object - An instance of `Gitlab::GithubImport::Representation::LfsObject`. project - An instance of `Project`.


11
12
13
14
# File 'lib/gitlab/github_import/importer/lfs_object_importer.rb', line 11

def initialize(lfs_object, project, _)
  @lfs_object = lfs_object
  @project = project
end

Instance Attribute Details

#lfs_objectObject (readonly)

Returns the value of attribute lfs_object


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

def lfs_object
  @lfs_object
end

#projectObject (readonly)

Returns the value of attribute project


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

def project
  @project
end

Instance Method Details

#executeObject


20
21
22
# File 'lib/gitlab/github_import/importer/lfs_object_importer.rb', line 20

def execute
  Projects::LfsPointers::LfsDownloadService.new(project, lfs_download_object).execute
end

#lfs_download_objectObject


16
17
18
# File 'lib/gitlab/github_import/importer/lfs_object_importer.rb', line 16

def lfs_download_object
  LfsDownloadObject.new(oid: lfs_object.oid, size: lfs_object.size, link: lfs_object.link)
end