Class: Quby::TableBackend::RangeTree

Inherits:
Object
  • Object
show all
Defined in:
lib/quby/table_backend/range_tree.rb

Instance Method Summary collapse

Constructor Details

#initialize(headers, compare, data) ⇒ RangeTree

Returns a new instance of RangeTree.



25
26
27
28
29
# File 'lib/quby/table_backend/range_tree.rb', line 25

def initialize(headers, compare, data)
  @data = data
  @headers = headers
  @compare = compare
end

Instance Method Details

#lookup(parameters) ⇒ Object

Given a parameters hash that contains a value or range for every header, find and return the normscore. ie. ‘lookup(10, raw: 5, scale: ’Inhibitie’, gender: ‘male’)‘ => 39



34
35
36
37
# File 'lib/quby/table_backend/range_tree.rb', line 34

def lookup(parameters)
  validate_parameters(parameters)
  lookup_score(parameters)
end