coopdevs/timeoverflow

View on GitHub
app/services/operations/transfers/one_to_many.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Operations
  module Transfers
    class OneToMany < Base
      def transfers
        destinations.map do |destination|
          build_transfer(
            source: source,
            destination: destination
          )
        end
      end

      private

      def source
        from.first
      end

      def destinations
        to
      end
    end
  end
end