Class: CDMBL::CompoundFilter
- Inherits:
-
Object
- Object
- CDMBL::CompoundFilter
- Defined in:
- lib/cdmbl/compound_filter.rb
Overview
Takes a list of record id/collection data, uses CompoundLookup to identifiy records with large numbers of compounds and sorts them into a large and a small heap
Instance Attribute Summary collapse
-
#cdm_endpoint ⇒ Object
readonly
Returns the value of attribute cdm_endpoint.
-
#compound_lookup_klass ⇒ Object
readonly
Returns the value of attribute compound_lookup_klass.
-
#max_compounds ⇒ Object
readonly
Returns the value of attribute max_compounds.
-
#record_ids ⇒ Object
readonly
Returns the value of attribute record_ids.
Instance Method Summary collapse
- #filter(large: true) ⇒ Object
-
#initialize(record_ids: [], max_compounds: 10, cdm_endpoint: '', compound_lookup_klass: CompoundLookup) ⇒ CompoundFilter
constructor
A new instance of CompoundFilter.
Constructor Details
#initialize(record_ids: [], max_compounds: 10, cdm_endpoint: '', compound_lookup_klass: CompoundLookup) ⇒ CompoundFilter
Returns a new instance of CompoundFilter.
10 11 12 13 14 15 16 17 18 |
# File 'lib/cdmbl/compound_filter.rb', line 10 def initialize(record_ids: [], max_compounds: 10, cdm_endpoint: '', compound_lookup_klass: CompoundLookup) @record_ids = record_ids @max_compounds = max_compounds @cdm_endpoint = cdm_endpoint @compound_lookup_klass = compound_lookup_klass end |
Instance Attribute Details
#cdm_endpoint ⇒ Object (readonly)
Returns the value of attribute cdm_endpoint.
6 7 8 |
# File 'lib/cdmbl/compound_filter.rb', line 6 def cdm_endpoint @cdm_endpoint end |
#compound_lookup_klass ⇒ Object (readonly)
Returns the value of attribute compound_lookup_klass.
6 7 8 |
# File 'lib/cdmbl/compound_filter.rb', line 6 def compound_lookup_klass @compound_lookup_klass end |
#max_compounds ⇒ Object (readonly)
Returns the value of attribute max_compounds.
6 7 8 |
# File 'lib/cdmbl/compound_filter.rb', line 6 def max_compounds @max_compounds end |
#record_ids ⇒ Object (readonly)
Returns the value of attribute record_ids.
6 7 8 |
# File 'lib/cdmbl/compound_filter.rb', line 6 def record_ids @record_ids end |
Instance Method Details
#filter(large: true) ⇒ Object
20 21 22 |
# File 'lib/cdmbl/compound_filter.rb', line 20 def filter(large: true) ids(records.select { |record| record[:large] == large }) end |