Class: Alma::BibSet

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/alma/bib_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_body_hash) ⇒ BibSet

Returns a new instance of BibSet.



12
13
14
# File 'lib/alma/bib_set.rb', line 12

def initialize(response_body_hash)
  @response = response_body_hash
end

Instance Attribute Details

#responseObject (readonly)

include Alma::Error



8
9
10
# File 'lib/alma/bib_set.rb', line 8

def response
  @response
end

Instance Method Details

#keyObject



22
23
24
# File 'lib/alma/bib_set.rb', line 22

def key
  'bib'
end

#listObject



16
17
18
19
20
# File 'lib/alma/bib_set.rb', line 16

def list
  @list ||= response.fetch(key, []).map do |record|
    Alma::Bib.new(record)
  end
end

#total_record_countObject



26
27
28
# File 'lib/alma/bib_set.rb', line 26

def total_record_count
  size
end