Class: Pubid::Bsi::Identifiers::AdoptedEuropeanNorm
Overview
AdoptedEuropeanNorm wraps CEN identifiers Example: “BS EN 10077-1:2006” where EN 10077-1:2006 is a CEN identifier object Example: “BS EN ISO 8601:2019” where EN ISO 8601:2019 is a CEN AdoptedEuropeanNorm wrapping ISO
Constant Summary
BritishStandard::TYPED_STAGES
Instance Method Summary
collapse
type
#<=>, #publisher
Methods inherited from Identifier
#base_identifier, #eql?, #exclude, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, #render, #resolve_urn_generator, #root, #to_mr_string, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code
Instance Method Details
#date ⇒ Object
77
78
79
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 77
def date
adopted_identifier&.date if adopted_identifier&.methods&.include?(:date)
end
|
#number ⇒ Object
Delegate common methods to adopted identifier
69
70
71
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 69
def number
adopted_identifier&.number
end
|
#part ⇒ Object
85
86
87
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 85
def part
adopted_identifier&.part if adopted_identifier&.methods&.include?(:part)
end
|
#parts ⇒ Object
81
82
83
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 81
def parts
adopted_identifier&.parts if adopted_identifier&.methods&.include?(:parts)
end
|
#subpart ⇒ Object
89
90
91
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 89
def subpart
adopted_identifier&.subpart if adopted_identifier&.methods&.include?(:subpart)
end
|
#to_s(lang: :en, lang_single: false) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 19
def to_s(lang: :en, lang_single: false)
prefix = case publisher
when Components::Publisher
publisher.body
when Array
publisher.join("/")
when String
publisher
else
"BS"
end
result = prefix
result += " #{adopted_identifier}" if adopted_identifier
result += " ED#{edition}" if edition
result += " (R#{reaffirmation_year})" if reaffirmation_year
if translation_lang
result += if translation_suffix_type == "version"
" (#{translation_lang} version)"
elsif translation_suffix_type == "Translation"
" (#{translation_lang} Translation)"
else
" (#{translation_lang})"
end
elsif translation_upper
result += if translation_suffix_type == "Translation"
" (#{translation_upper} Translation)"
else
" (#{translation_upper})"
end
end
if
result += if
" ExComm (#{})"
else
" ExComm"
end
end
result
end
|
#year ⇒ Object
73
74
75
|
# File 'lib/pubid/bsi/identifiers/adopted_european_norm.rb', line 73
def year
adopted_identifier&.year if adopted_identifier&.methods&.include?(:year)
end
|