debian-mirror-gitlab/lib/bulk_imports/pipeline/context.rb

29 lines
489 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
module BulkImports
module Pipeline
class Context
2021-03-11 19:13:27 +05:30
attr_reader :entity, :bulk_import
attr_accessor :extra
2021-01-29 00:20:46 +05:30
2021-03-11 19:13:27 +05:30
def initialize(entity, extra = {})
@entity = entity
@bulk_import = entity.bulk_import
@extra = extra
2021-01-29 00:20:46 +05:30
end
2021-03-11 19:13:27 +05:30
def group
entity.group
end
2021-01-29 00:20:46 +05:30
2021-03-11 19:13:27 +05:30
def current_user
bulk_import.user
2021-01-29 00:20:46 +05:30
end
2021-03-11 19:13:27 +05:30
def configuration
bulk_import.configuration
2021-01-29 00:20:46 +05:30
end
end
end
end