Sha256: 0ad710067d846077b748b10f48246679697ff10cf8bfbda929d5e2bd96f32942

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResult
        module Entities
          class Result
            module Plugins
              module HasJsendStatusAndAttributes
                module Commands
                  class CastJSendAttributes < Support::Command
                    attr_reader :attributes

                    def initialize(attributes:)
                      @attributes = attributes
                    end

                    def call
                      Structs::JSendAttributes.new(
                        service: attributes[:service],
                        status: Entities::Status.cast!(attributes[:status]),
                        data: Entities::Data.cast!(attributes[:data]),
                        message: Entities::Message.cast!(attributes[:message]),
                        code: Entities::Code.cast!(attributes[:code])
                      )
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.10.1 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.10.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.9.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.8.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.7.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.6.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result/entities/result/plugins/has_jsend_status_and_attributes/commands/cast_jsend_attributes.rb