Sha256: 0739e06759e3f9f564a04745e897e0781a2291b2a0e64ad6afa3531700e2ef8f

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

require 'duckface'
require 'clean_architecture/interfaces/success_payload'
require 'clean_architecture/serializers/success_payload'

module CleanArchitecture
  module Serializers
    class SuccessCollectionPayload
      implements_interface CleanArchitecture::Interfaces::SuccessPayload

      def initialize(collection, use_case_target_class)
        @collection = collection
        @use_case_target_class = use_case_target_class
      end

      def data
        @collection.map do |object|
          SuccessPayload.new(@use_case_target_class.new(object)).data
        end
      end

      def version
        '1.0'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clean-architecture-2.0.0 lib/clean_architecture/serializers/success_collection_payload.rb