Class: Alma::BibHolding

Inherits:
Object
  • Object
show all
Extended by:
ApiDefaults, Forwardable
Defined in:
lib/alma/bib_holding.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ApiDefaults

apikey, bibs_base_path, configuration_base_path, headers, items_base_path, region, timeout, users_base_path

Constructor Details

#initialize(holding) ⇒ BibHolding

Returns a new instance of BibHolding.



17
18
19
# File 'lib/alma/bib_holding.rb', line 17

def initialize(holding)
  @holding = holding
end

Instance Attribute Details

#holdingObject (readonly)

Returns the value of attribute holding.



14
15
16
# File 'lib/alma/bib_holding.rb', line 14

def holding
  @holding
end

Class Method Details

.find(mms_id:, holding_id:) ⇒ Object



8
9
10
11
12
# File 'lib/alma/bib_holding.rb', line 8

def self.find(mms_id:, holding_id:)
  url = "#{bibs_base_path}/#{mms_id}/holdings/#{holding_id}"
  response = Net.get(url, headers:, timeout:)
  new(response)
end

Instance Method Details

#holding_idObject



21
22
23
# File 'lib/alma/bib_holding.rb', line 21

def holding_id
  holding["holding_id"]
end