debian-mirror-gitlab/lib/bulk_imports/pipeline/context.rb
2021-04-29 21:17:54 +05:30

36 lines
626 B
Ruby

# frozen_string_literal: true
module BulkImports
module Pipeline
class Context
attr_accessor :extra
attr_reader :tracker
def initialize(tracker, extra = {})
@tracker = tracker
@extra = extra
end
def entity
@entity ||= tracker.entity
end
def group
@group ||= entity.group
end
def bulk_import
@bulk_import ||= entity.bulk_import
end
def current_user
@current_user ||= bulk_import.user
end
def configuration
@configuration ||= bulk_import.configuration
end
end
end
end