Class: Quby::TableBackend::RangeTree
- Inherits:
-
Object
- Object
- Quby::TableBackend::RangeTree
- Defined in:
- lib/quby/table_backend/range_tree.rb
Instance Method Summary collapse
-
#initialize(levels:, tree:) ⇒ RangeTree
constructor
A new instance of RangeTree.
-
#lookup(parameters) ⇒ Object
Given a parameters hash that contains a value or range for every level in the tree, find and return the normscore.
Constructor Details
#initialize(levels:, tree:) ⇒ RangeTree
Returns a new instance of RangeTree.
32 33 34 35 |
# File 'lib/quby/table_backend/range_tree.rb', line 32 def initialize(levels:, tree:) @levels = levels @tree = tree end |
Instance Method Details
#lookup(parameters) ⇒ Object
Given a parameters hash that contains a value or range for every level in the tree, find and return the normscore. ie. ‘lookup(10, raw: 5, scale: ’Inhibitie’, gender: ‘male’)‘ => 39
40 41 42 43 |
# File 'lib/quby/table_backend/range_tree.rb', line 40 def lookup(parameters) validate_parameters(parameters) lookup_score(parameters) end |