Class: Gitlab::ImportExport::FastHashSerializer
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::FastHashSerializer
- Defined in:
- lib/gitlab/import_export/fast_hash_serializer.rb
Defined Under Namespace
Classes: JSONBatchRelation
Constant Summary collapse
- BATCH_SIZE =
100
Instance Attribute Summary collapse
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tree ⇒ Object
readonly
Returns the value of attribute tree.
Instance Method Summary collapse
-
#execute ⇒ Object
With the usage of ‘JSONBatchRelation`, it returns partially serialized hash which is not easily accessible.
-
#initialize(subject, tree, batch_size: BATCH_SIZE) ⇒ FastHashSerializer
constructor
A new instance of FastHashSerializer.
Constructor Details
#initialize(subject, tree, batch_size: BATCH_SIZE) ⇒ FastHashSerializer
Returns a new instance of FastHashSerializer.
76 77 78 79 80 |
# File 'lib/gitlab/import_export/fast_hash_serializer.rb', line 76 def initialize(subject, tree, batch_size: BATCH_SIZE) @subject = subject @batch_size = batch_size @tree = tree end |
Instance Attribute Details
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
27 28 29 |
# File 'lib/gitlab/import_export/fast_hash_serializer.rb', line 27 def subject @subject end |
#tree ⇒ Object (readonly)
Returns the value of attribute tree.
27 28 29 |
# File 'lib/gitlab/import_export/fast_hash_serializer.rb', line 27 def tree @tree end |
Instance Method Details
#execute ⇒ Object
With the usage of ‘JSONBatchRelation`, it returns partially serialized hash which is not easily accessible. It means you can only manipulate and replace top-level objects. All future mutations of the hash (such as `fix_project_tree`) should be aware of that.
87 88 89 |
# File 'lib/gitlab/import_export/fast_hash_serializer.rb', line 87 def execute simple_serialize.merge(serialize_includes) end |