lib/relaton_ietf/rfc_entry.rb in relaton-ietf-1.13.7 vs lib/relaton_ietf/rfc_entry.rb in relaton-ietf-1.13.8

- old
+ new

@@ -147,19 +147,26 @@ # # Parse document contributors # # @return [Array<RelatonBib::ContributionInfo>] document contributors # - def parse_contributor - @doc.xpath("./xmlns:author").map do |contrib| + def parse_contributor # rubocop:disable Metrics/MethodLength + contribs = @doc.xpath("./xmlns:author").map do |contrib| name = contrib.at("./xmlns:name").text entity = BibXMLParser.full_name_org name unless entity fname = BibXMLParser.full_name name, nil, nil, "en", "Latn" entity = RelatonBib::Person.new(name: fname) end RelatonBib::ContributionInfo.new(entity: entity, role: parse_role(contrib)) end + contribs << create_org_contrib("RFC Publisher", "publisher") + contribs << create_org_contrib("RFC Series", "authorizer") + end + + def create_org_contrib(org_name, role_type) + org = RelatonBib::Organization.new name: org_name + RelatonBib::ContributionInfo.new entity: org, role: [{ type: role_type }] end # # Parse contributors role #