Class: CDMBL::OAISetLookup
- Inherits:
-
Object
- Object
- CDMBL::OAISetLookup
- Defined in:
- lib/cdmbl/oai_set_lookup.rb
Overview
Takes a hash representing an OAI ListSets response and turns that into a lookup table based on the setSpec
Instance Attribute Summary collapse
-
#oai_sets ⇒ Object
readonly
Returns the value of attribute oai_sets.
Instance Method Summary collapse
-
#initialize(oai_sets: {}) ⇒ OAISetLookup
constructor
A new instance of OAISetLookup.
- #keyed ⇒ Object
Constructor Details
#initialize(oai_sets: {}) ⇒ OAISetLookup
9 10 11 |
# File 'lib/cdmbl/oai_set_lookup.rb', line 9 def initialize(oai_sets: {}) @oai_sets = oai_sets end |
Instance Attribute Details
#oai_sets ⇒ Object (readonly)
Returns the value of attribute oai_sets.
8 9 10 |
# File 'lib/cdmbl/oai_set_lookup.rb', line 8 def oai_sets @oai_sets end |
Instance Method Details
#keyed ⇒ Object
13 14 15 |
# File 'lib/cdmbl/oai_set_lookup.rb', line 13 def keyed oai_sets.at_path('OAI_PMH/ListSets/set').inject({}) {|memo, set| memo.merge(to_key(set)) } end |