lib/micro_micro/collections/items_collection.rb in micromicro-1.1.0 vs lib/micro_micro/collections/items_collection.rb in micromicro-2.0.0
- old
+ new
@@ -1,15 +1,17 @@
+# frozen_string_literal: true
+
module MicroMicro
module Collections
class ItemsCollection < BaseCollection
# @return [Array<Hash{Symbol => Array<String, Hash>}>]
def to_a
map(&:to_h)
end
# @return [Array<String>]
def types
- @types ||= map(&:types).flatten.uniq.sort
+ @types ||= flat_map(&:types).uniq.sort
end
end
end
end