Class: Pubid::Bsi::Identifiers::AdoptedInternationalStandard
Overview
AdoptedInternationalStandard wraps ISO/IEC identifiers directly Example: “BS ISO 8601:2019” where ISO 8601:2019 is an ISO identifier object Example: “BS IEC 62600:2020” where IEC 62600:2020 is an IEC identifier object
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
68
69
70
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 68
def date
adopted_identifier&.date if adopted_identifier&.methods&.include?(:date)
end
|
#number ⇒ Object
Delegate common methods to adopted identifier
60
61
62
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 60
def number
adopted_identifier&.number
end
|
#part ⇒ Object
76
77
78
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 76
def part
adopted_identifier&.part if adopted_identifier&.methods&.include?(:part)
end
|
#parts ⇒ Object
72
73
74
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 72
def parts
adopted_identifier&.parts if adopted_identifier&.methods&.include?(:parts)
end
|
#to_s ⇒ 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
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 19
def to_s
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 += " (#{translation_lang})"
elsif translation_upper
result += " (#{translation_upper})"
end
if
result += if
" ExComm (#{})"
else
" ExComm"
end
end
result
end
|
#year ⇒ Object
64
65
66
|
# File 'lib/pubid/bsi/identifiers/adopted_international_standard.rb', line 64
def year
adopted_identifier&.year if adopted_identifier&.methods&.include?(:year)
end
|