Class: DeepLDiff::Chunker
- Inherits:
-
Object
- Object
- DeepLDiff::Chunker
- Extended by:
- Dry::Initializer
- Defined in:
- lib/deepl_diff/chunker.rb
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'lib/deepl_diff/chunker.rb', line 14 def call chunks.map(&:values) end |
#chunks ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/deepl_diff/chunker.rb', line 18 def chunks values.each_with_object([]) do |value, chunks| validate_value_size(value) tail = chunks.last if next_chunk?(tail, value) chunks << Chunk.new([], 0) tail = chunks.last end update_chunk(tail, value) end end |