6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/pubid/astm/builder.rb', line 6
def build(parsed_hash)
identifier_class = determine_identifier_class(parsed_hash)
identifier = identifier_class.new
if parsed_hash[:letter] || parsed_hash[:number]
identifier.code = build_code(parsed_hash)
end
if parsed_hash[:type]&.to_s == "ISO/ASTMTR"
identifier.publisher = "ISO/ASTM"
else
identifier.publisher = parsed_hash[:publisher].to_s if parsed_hash[:publisher]
identifier.publisher ||= "ASTM"
end
if parsed_hash[:year]
identifier.year = convert_year(parsed_hash[:year].to_s)
end
if parsed_hash[:format_suffix]
identifier.format_suffix = "-#{parsed_hash[:format_suffix]}"
end
build_type_specific_attributes(identifier, parsed_hash)
identifier
end
|