class Classifoclc::Edition
An expression of a work. The physical books libraries held (or their digitizations) are “manifestations” of these editions
Attributes
classifications[R]
Public Class Methods
new(node)
click to toggle source
# File lib/classifoclc/edition.rb, line 7 def initialize(node) @edition = node @classifications = load_classifications(node) end
Public Instance Methods
eholdings()
click to toggle source
The number of libraries that hold a digital copy of this work @return [Integer]
# File lib/classifoclc/edition.rb, line 50 def eholdings @edition['eholdings'].to_i end
format()
click to toggle source
The format of the edition @return [String]
# File lib/classifoclc/edition.rb, line 32 def format @edition['format'] end
holdings()
click to toggle source
The number of libraries that hold a copy of this work @return [Integer]
# File lib/classifoclc/edition.rb, line 44 def holdings @edition['holdings'].to_i end
itemtype()
click to toggle source
The type of item the edition @return [String]
# File lib/classifoclc/edition.rb, line 38 def itemtype @edition['itemtype'] end
language()
click to toggle source
The language of item the edition @return [String]
# File lib/classifoclc/edition.rb, line 56 def language @edition['language'] end
oclc()
click to toggle source
The OCLC number of the edition @return [String]
# File lib/classifoclc/edition.rb, line 14 def oclc @edition['oclc'] end
title()
click to toggle source
The title of the edition @return [String]
# File lib/classifoclc/edition.rb, line 26 def title @edition['title'] end
Private Instance Methods
load_classifications(node)
click to toggle source
# File lib/classifoclc/edition.rb, line 60 def load_classifications(node) cls = node.css("classifications class") return nil if cls.empty? cls.map{|c| Hash[c.keys.map{|k| [k.to_sym, c[k]]}]} end