Class: ClosestNeighbours::Indexer
- Inherits:
-
Object
- Object
- ClosestNeighbours::Indexer
- Defined in:
- lib/closest_neighbours/indexer.rb
Overview
Determines the indexes where the data need to be grouped
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(groups = 1, data = []) ⇒ Indexer
constructor
A new instance of Indexer.
Constructor Details
#initialize(groups = 1, data = []) ⇒ Indexer
Returns a new instance of Indexer.
6 7 8 9 |
# File 'lib/closest_neighbours/indexer.rb', line 6 def initialize(groups = 1, data = []) @groups = groups @data = data end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/closest_neighbours/indexer.rb', line 11 def call [0] + indexes + [data.count] end |