From b0d790d2162c206c0955b0889068f4f8060080a7 Mon Sep 17 00:00:00 2001 From: Timur Tarasenko Date: Tue, 9 Oct 2018 23:11:29 -0500 Subject: [PATCH] Refactoing flatten.map --- lib/onix/onix21.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/onix/onix21.rb b/lib/onix/onix21.rb index ceb02df..1c56cd0 100644 --- a/lib/onix/onix21.rb +++ b/lib/onix/onix21.rb @@ -399,7 +399,7 @@ def clil_categories_codes def keywords kws=(@main_subjects + @subjects).select { |s| s.scheme_identifier.human=="Keywords" }.map { |kw| kw.heading_text }.compact - kws.map { |kw| kw.split(/;|,|\n/) }.flatten.map { |kw| kw.strip } + kws.map { |kw| kw.split(/;|,|\n/) }.flat_map { |kw| kw.strip } end # doesn't apply