Class: ONIX::PublishingDetail
Instance Method Summary
collapse
Methods inherited from SubsetDSL
_ancestor_registered_scopes, _ancestors_registered_elements, ancestor_registered_scopes, ancestors_registered_elements, element, elements, get_class, #initialize, #parse, ref_to_short, registered_elements, registered_scopes, scope, short_to_ref, #unsupported
Methods inherited from Subset
parse, #parse, tag_match, #tag_match, #unsupported
Instance Method Details
#city ⇒ Object
77
78
79
|
# File 'lib/onix/publishing_detail.rb', line 77
def city
@city_of_publication
end
|
#country ⇒ Object
81
82
83
|
# File 'lib/onix/publishing_detail.rb', line 81
def country
@country_of_publication
end
|
#embargo_date ⇒ Object
46
47
48
49
50
51
52
53
|
# File 'lib/onix/publishing_detail.rb', line 46
def embargo_date
pub=@publishing_dates.embargo.first
if pub
pub.date
else
nil
end
end
|
#imprint ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/onix/publishing_detail.rb', line 25
def imprint
if @imprints.length > 0
if @imprints.length==1
@imprints.first
else
raise ExpectsOneButHasSeveral, @imprints.map(&:name)
end
else
nil
end
end
|
#preorder_embargo_date ⇒ Object
55
56
57
58
59
60
61
62
|
# File 'lib/onix/publishing_detail.rb', line 55
def preorder_embargo_date
pub=@publishing_dates.preorder_embargo.first
if pub
pub.date
else
nil
end
end
|
#public_announcement_date ⇒ Object
64
65
66
67
68
69
70
71
|
# File 'lib/onix/publishing_detail.rb', line 64
def public_announcement_date
pub=@publishing_dates.public_announcement.first
if pub
pub.date
else
nil
end
end
|
#publication_date ⇒ Object
37
38
39
40
41
42
43
44
|
# File 'lib/onix/publishing_detail.rb', line 37
def publication_date
pub=@publishing_dates.publication.first
if pub
pub.date
else
nil
end
end
|
#publisher ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/onix/publishing_detail.rb', line 15
def publisher
main_publishers = @publishers.select { |p| p.role.human=="Publisher" }
return nil if main_publishers.empty?
if main_publishers.length == 1
main_publishers.first
else
raise ExpectsOneButHasSeveral, main_publishers.map(&:name)
end
end
|
#status ⇒ Object
73
74
75
|
# File 'lib/onix/publishing_detail.rb', line 73
def status
@publising_status
end
|