Class: Xcopier::Operation
- Inherits:
-
Object
- Object
- Xcopier::Operation
- Defined in:
- lib/xcopier/operation.rb
Instance Attribute Summary collapse
-
#anonymize ⇒ Object
readonly
Returns the value of attribute anonymize.
-
#chunk_size ⇒ Object
readonly
Returns the value of attribute chunk_size.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#overrides ⇒ Object
readonly
Returns the value of attribute overrides.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(copier, name:, model: nil, scope: nil, chunk_size: 500, overrides: {}, anonymize: []) ⇒ Operation
constructor
rubocop:disable Metrics/ParameterLists.
- #inspect ⇒ Object
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
#anonymize ⇒ Object (readonly)
Returns the value of attribute anonymize.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def anonymize @anonymize end |
#chunk_size ⇒ Object (readonly)
Returns the value of attribute chunk_size.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def chunk_size @chunk_size end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def name @name end |
#overrides ⇒ Object (readonly)
Returns the value of attribute overrides.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def overrides @overrides end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/xcopier/operation.rb', line 7 def scope @scope end |
Instance Method Details
#inspect ⇒ Object
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 |