Class: Contrek::Concurrent::Merger
- Includes:
- Poolable
- Defined in:
- lib/contrek/finder/concurrent/merger.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#tiles ⇒ Object
readonly
Returns the value of attribute tiles.
Attributes included from Poolable
Attributes inherited from Finder
Instance Method Summary collapse
- #add_tile(result) ⇒ Object
-
#initialize(options: {}) ⇒ Merger
constructor
A new instance of Merger.
- #process_info ⇒ Object
Methods included from Poolable
Constructor Details
#initialize(options: {}) ⇒ Merger
Returns a new instance of Merger.
9 10 11 12 13 14 15 |
# File 'lib/contrek/finder/concurrent/merger.rb', line 9 def initialize(options: {}) @initialize_time = 0 @current_x = 0 @tiles = Queue.new @whole_tile = nil @options = end |
Instance Attribute Details
#tiles ⇒ Object (readonly)
Returns the value of attribute tiles.
6 7 8 |
# File 'lib/contrek/finder/concurrent/merger.rb', line 6 def tiles @tiles end |
Instance Method Details
#add_tile(result) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/contrek/finder/concurrent/merger.rb', line 17 def add_tile(result) @height ||= result.[:height] end_x = @current_x + result.[:width] tile = Tile.new( finder: self, start_x: @current_x, end_x: end_x, name: @tiles.size.to_s ) tile.assign_raw_polygons!(result[:polygons]) @tiles << tile @maximum_width = end_x @current_x = end_x - 1 end |
#process_info ⇒ Object
34 35 36 37 |
# File 'lib/contrek/finder/concurrent/merger.rb', line 34 def process_info process_tiles!(nil, height: @height) super end |