Sha256: 4b302e1d507e28bc32830e1b28bacfec38ffec981f31d592f66c66d868df7cc0

Contents?: true

Size: 343 Bytes

Versions: 2

Compression:

Stored size: 343 Bytes

Contents

# 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 ||= flat_map(&:types).uniq.sort
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
micromicro-2.0.1 lib/micro_micro/collections/items_collection.rb
micromicro-2.0.0 lib/micro_micro/collections/items_collection.rb