Sha256: 787396abbff39596886b3eb1503e11ea19563fbb82fc48fa4ba49b9ea41176a7

Contents?: true

Size: 435 Bytes

Versions: 10

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true

module Micro
  module Cases

    module Utils
      def self.map_use_cases(args)
        collection = args.is_a?(Array) && args.size == 1 ? args[0] : args

        Array(collection).each_with_object([]) do |arg, memo|
          if arg.is_a?(Flow)
            arg.use_cases.each { |use_case| memo << use_case }
          else
            memo << arg
          end
        end
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
u-case-4.5.2 lib/micro/cases/utils.rb
u-case-4.5.1 lib/micro/cases/utils.rb
u-case-4.5.0 lib/micro/cases/utils.rb
u-case-4.4.0 lib/micro/cases/utils.rb
u-case-4.3.0 lib/micro/cases/utils.rb
u-case-4.2.2 lib/micro/cases/utils.rb
u-case-4.2.1 lib/micro/cases/utils.rb
u-case-4.2.0 lib/micro/cases/utils.rb
u-case-4.1.1 lib/micro/cases/utils.rb
u-case-4.1.0 lib/micro/cases/utils.rb