lib/relaton_iec/data_parser.rb in relaton-iec-1.14.2 vs lib/relaton_iec/data_parser.rb in relaton-iec-1.14.3

- old
+ new

@@ -175,17 +175,19 @@ # Parse dates. # # @return [Array<RelatonBib::BibliographicDate>] dates # def date - date = [] - date << create_date("published", @pub["releaseDate"]) if @pub["releaseDate"] - date << create_date("confirmed", @pub["confirmationDate"]) if @pub["confirmationDate"] - date - end + { + "published" => "publicationDate", + "stable-until" => "stabilityDate", + "confirmed" => "confirmationDate", + "obsoleted" => "dateOfWithdrawal", + }.reduce([]) do |a, (k, v)| + next a unless @pub[v] - def create_date(type, date) - RelatonBib::BibliographicDate.new(type: type, on: date) + a << RelatonBib::BibliographicDate.new(type: k, on: @pub[v]) + end end # # Parse contributors. #