Class: Xcopier::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/xcopier/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(copier, name:, model: nil, scope: nil, chunk_size: 500, overrides: {}, anonymize: []) ⇒ Operation

rubocop:disable Metrics/ParameterLists



9
10
11
12
13
14
15
16
17
# File 'lib/xcopier/operation.rb', line 9

def initialize(copier, name:, model: nil, scope: nil, chunk_size: 500, overrides: {}, anonymize: []) # rubocop:disable Metrics/ParameterLists
  @name = name
  @model = model
  @scope = scope
  @chunk_size = chunk_size
  @overrides = overrides.is_a?(Hash) ? overrides.with_indifferent_access : overrides
  @anonymize = anonymize.is_a?(Array) ? anonymize.map(&:to_s) : anonymize
  prepare_model_and_scope(copier)
end

Instance Attribute Details

#anonymizeObject (readonly)

Returns the value of attribute anonymize.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def anonymize
  @anonymize
end

#chunk_sizeObject (readonly)

Returns the value of attribute chunk_size.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def chunk_size
  @chunk_size
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def name
  @name
end

#overridesObject (readonly)

Returns the value of attribute overrides.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def overrides
  @overrides
end

#scopeObject (readonly)

Returns the value of attribute scope.



7
8
9
# File 'lib/xcopier/operation.rb', line 7

def scope
  @scope
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/xcopier/operation.rb', line 19

def inspect
  "#<#{self.class.name} name: #{name}, model: #{model.name}, chunk_size: #{chunk_size}, overrides: #{overrides.inspect}, anonymize: #{anonymize.inspect}>"
end