Class: BlacklightOaiProvider::Set
- Inherits:
-
Object
- Object
- BlacklightOaiProvider::Set
- Defined in:
- lib/blacklight_oai_provider/set.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.controller ⇒ Object
The controller, used to construct solr queries.
-
.fields ⇒ Object
Solr field configuration for each set Fields must be indexed.
Instance Attribute Summary collapse
-
#description ⇒ Object
OAI Set properties.
-
#label ⇒ Object
OAI Set properties.
-
#value ⇒ Object
OAI Set properties.
Class Method Summary collapse
-
.all ⇒ Object
Return an array of all SetSpecs, or nil if sets are not supported.
-
.from_spec(spec) ⇒ Object
Return a Solr filter query given a set spec.
-
.sets_for(record) ⇒ Object
Returns array of sets for a record, or empty array if none are available.
Instance Method Summary collapse
-
#initialize(spec) ⇒ Set
constructor
Build a set object with, at minimum, a set spec string.
- #name ⇒ Object
- #spec ⇒ Object
Constructor Details
#initialize(spec) ⇒ Set
Build a set object with, at minimum, a set spec string
36 37 38 39 |
# File 'lib/blacklight_oai_provider/set.rb', line 36 def initialize(spec) @label, @value = spec.split(':', 2) raise OAI::ArgumentException if [@label, @value].any?(&:blank?) end |
Class Attribute Details
.controller ⇒ Object
The controller, used to construct solr queries
5 6 7 |
# File 'lib/blacklight_oai_provider/set.rb', line 5 def controller @controller end |
.fields ⇒ Object
Solr field configuration for each set Fields must be indexed
9 10 11 |
# File 'lib/blacklight_oai_provider/set.rb', line 9 def fields @fields end |
Instance Attribute Details
#description ⇒ Object
OAI Set properties
33 34 35 |
# File 'lib/blacklight_oai_provider/set.rb', line 33 def description @description end |
#label ⇒ Object
OAI Set properties
33 34 35 |
# File 'lib/blacklight_oai_provider/set.rb', line 33 def label @label end |
#value ⇒ Object
OAI Set properties
33 34 35 |
# File 'lib/blacklight_oai_provider/set.rb', line 33 def value @value end |
Class Method Details
.all ⇒ Object
Return an array of all SetSpecs, or nil if sets are not supported. Objects returned must be of a class that inherits from BlacklightOaiProvider::SetSpecs.
14 15 16 |
# File 'lib/blacklight_oai_provider/set.rb', line 14 def all raise NotImplementedError end |
.from_spec(spec) ⇒ Object
Return a Solr filter query given a set spec. Spec will be a string in label:value format.
20 21 22 |
# File 'lib/blacklight_oai_provider/set.rb', line 20 def from_spec(spec) raise NotImplementedError end |
.sets_for(record) ⇒ Object
Returns array of sets for a record, or empty array if none are available. Objects returned must be of a class that inherits from BlacklightOaiProvider::SetSpecs.
27 28 29 |
# File 'lib/blacklight_oai_provider/set.rb', line 27 def sets_for(record) raise NotImplementedError end |
Instance Method Details
#name ⇒ Object
41 42 43 |
# File 'lib/blacklight_oai_provider/set.rb', line 41 def name raise NotImplementedError end |
#spec ⇒ Object
45 46 47 |
# File 'lib/blacklight_oai_provider/set.rb', line 45 def spec raise NotImplementedError end |