Class: CDMBL::CompoundLookup
- Inherits:
-
Object
- Object
- CDMBL::CompoundLookup
- Defined in:
- lib/cdmbl/compound_lookup.rb
Overview
Fetching the full metadata for compound records is expensive. This class lets us check on how many compounds a CDM record has so that we know
Instance Attribute Summary collapse
-
#cdm_endpoint ⇒ Object
readonly
Returns the value of attribute cdm_endpoint.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#request_klass ⇒ Object
readonly
Returns the value of attribute request_klass.
-
#service_klass ⇒ Object
readonly
Returns the value of attribute service_klass.
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize(cdm_endpoint: '', collection: '', id: '', request_klass: CONTENTdmAPI::Request, service_klass: CONTENTdmAPI::Service) ⇒ CompoundLookup
constructor
A new instance of CompoundLookup.
Constructor Details
#initialize(cdm_endpoint: '', collection: '', id: '', request_klass: CONTENTdmAPI::Request, service_klass: CONTENTdmAPI::Service) ⇒ CompoundLookup
Returns a new instance of CompoundLookup.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cdmbl/compound_lookup.rb', line 11 def initialize(cdm_endpoint: '', collection: '', id: '', request_klass: CONTENTdmAPI::Request, service_klass: CONTENTdmAPI::Service) @cdm_endpoint = cdm_endpoint @collection = collection @id = id @request_klass = request_klass @service_klass = service_klass end |
Instance Attribute Details
#cdm_endpoint ⇒ Object (readonly)
Returns the value of attribute cdm_endpoint.
5 6 7 |
# File 'lib/cdmbl/compound_lookup.rb', line 5 def cdm_endpoint @cdm_endpoint end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
5 6 7 |
# File 'lib/cdmbl/compound_lookup.rb', line 5 def collection @collection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/cdmbl/compound_lookup.rb', line 5 def id @id end |
#request_klass ⇒ Object (readonly)
Returns the value of attribute request_klass.
5 6 7 |
# File 'lib/cdmbl/compound_lookup.rb', line 5 def request_klass @request_klass end |
#service_klass ⇒ Object (readonly)
Returns the value of attribute service_klass.
5 6 7 |
# File 'lib/cdmbl/compound_lookup.rb', line 5 def service_klass @service_klass end |
Instance Method Details
#count ⇒ Object
23 24 25 |
# File 'lib/cdmbl/compound_lookup.rb', line 23 def count page.respond_to?(:length) ? page.length : 0 end |