Sha256: 8935e8d0336647d33211da45cd2b65029647ba0e05a4186bff3702475eff1201

Contents?: true

Size: 343 Bytes

Versions: 11

Compression:

Stored size: 343 Bytes

Contents

class TestModel
  def initialize(vector = [rand(0..100), rand(0..100), rand(0..100)])
    @vector = vector
  end

  def clustering_vector(vector_params)
    if vector_params[:type] == 'Hash'
      vector_as_hash = {}
      @vector.map.with_index{ |x,i| vector_as_hash[i] = x }
      return vector_as_hash
    end

    return @vector
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
db_clustering-0.1.17 spec/support/test_model.rb
db_clustering-0.1.16 spec/support/test_model.rb
db_clustering-0.1.15 spec/support/test_model.rb
db_clustering-0.1.14 spec/support/test_model.rb
db_clustering-0.1.13 spec/support/test_model.rb
db_clustering-0.1.12 spec/support/test_model.rb
db_clustering-0.1.11 spec/support/test_model.rb
db_clustering-0.1.10 spec/support/test_model.rb
db_clustering-0.1.9 spec/support/test_model.rb
db_clustering-0.1.8 spec/support/test_model.rb
db_clustering-0.1.7 spec/support/test_model.rb