Class: BulkImports::Pipeline::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/bulk_imports/pipeline/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tracker, extra = {}) ⇒ Context

Returns a new instance of Context.


10
11
12
13
# File 'lib/bulk_imports/pipeline/context.rb', line 10

def initialize(tracker, extra = {})
  @tracker = tracker
  @extra = extra
end

Instance Attribute Details

#extraObject

Returns the value of attribute extra.


6
7
8
# File 'lib/bulk_imports/pipeline/context.rb', line 6

def extra
  @extra
end

#trackerObject (readonly)

Returns the value of attribute tracker.


8
9
10
# File 'lib/bulk_imports/pipeline/context.rb', line 8

def tracker
  @tracker
end

Instance Method Details

#bulk_importObject


31
32
33
# File 'lib/bulk_imports/pipeline/context.rb', line 31

def bulk_import
  @bulk_import ||= entity.bulk_import
end

#configurationObject


39
40
41
# File 'lib/bulk_imports/pipeline/context.rb', line 39

def configuration
  @configuration ||= bulk_import.configuration
end

#current_userObject


35
36
37
# File 'lib/bulk_imports/pipeline/context.rb', line 35

def current_user
  @current_user ||= bulk_import.user
end

#entityObject


15
16
17
# File 'lib/bulk_imports/pipeline/context.rb', line 15

def entity
  @entity ||= tracker.entity
end

#groupObject


27
28
29
# File 'lib/bulk_imports/pipeline/context.rb', line 27

def group
  @group ||= entity.group
end

#import_export_configObject


23
24
25
# File 'lib/bulk_imports/pipeline/context.rb', line 23

def import_export_config
  @import_export_config ||= ::BulkImports::FileTransfer.config_for(portable)
end

#portableObject


19
20
21
# File 'lib/bulk_imports/pipeline/context.rb', line 19

def portable
  @portable ||= entity.group || entity.project
end