Sha256: 4c76c7a6cc799b71134c7eba1f6ad8813389a485bcdf1b07b3eafbc2742a2269

Contents?: true

Size: 625 Bytes

Versions: 8

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

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

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

      attr_reader :version

      def initialize(use_case_target, version)
        @use_case_target = use_case_target
        @version = version
      end

      def data_hash
        {
          type: @use_case_target.type_name,
          id: @use_case_target.identifier,
          attributes: @use_case_target.attribute_hash
        }.compact
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
clean-architecture-1.2.0 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-1.1.1 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-1.1.0 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-1.0.1 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-1.0.0 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-0.2.0 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-0.1.0 lib/clean_architecture/serializers/success_payload.rb
clean-architecture-0.0.5 lib/clean_architecture/serializers/success_payload.rb