push
circleci
47 of 9721 relevant lines covered (0.48%)
0.01 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
require 'openurl/context_object'
|
× |
3 |
|
|
4 |
module Blacklight |
× |
5 |
module Marc |
× |
6 |
# Create an OpenUrl ContextObject for a book
|
|
7 |
class BookCtxBuilder < CtxBuilder |
× |
8 |
def build |
× |
9 |
ctx.referent.set_format('book')
|
× |
10 |
apply_metadata |
× |
11 |
ctx |
× |
12 |
end
|
× |
13 |
|
|
14 |
private |
× |
15 |
|
|
16 |
def mapping |
× |
17 |
{ |
× |
18 |
genre: 'book', |
× |
19 |
au: author,
|
× |
20 |
pub: publisher,
|
× |
21 |
edition:,
|
× |
22 |
isbn:,
|
× |
23 |
date:,
|
× |
24 |
title:,
|
× |
25 |
btitle: title,
|
× |
26 |
oclc:,
|
× |
27 |
lccn:
|
× |
28 |
} |
× |
29 |
end
|
× |
30 |
|
|
31 |
def edition |
× |
32 |
@document['edition_display']&.first |
× |
33 |
end
|
× |
34 |
end
|
× |
35 |
end
|
× |
36 |
end
|
× |