Sha256: 2219ef57b2506157c60ba50032163716ba3a577acc0b3d13bfb03ccfe2845823

Contents?: true

Size: 1.33 KB

Versions: 13

Compression:

Stored size: 1.33 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResult
        module Concern
          module InstanceMethods
            ##
            # @api public
            # @raise [ConvenientService::Service::Plugins::HasResult::Errors::ResultIsNotOverridden]
            #
            def result
              raise Errors::ResultIsNotOverridden.new(service: self)
            end

            ##
            # @api public
            # @param kwargs [Hash]
            # @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
            #
            def success(**kwargs)
              self.class.success(**kwargs.merge(service: self))
            end

            ##
            # @api public
            # @param kwargs [Hash]
            # @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
            #
            def failure(**kwargs)
              self.class.failure(**kwargs.merge(service: self))
            end

            ##
            # @api public
            # @param kwargs [Hash]
            # @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
            #
            def error(**kwargs)
              self.class.error(**kwargs.merge(service: self))
            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/concern/instance_methods.rb
convenient_service-0.10.1 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.10.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.9.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.8.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.7.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.6.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result/concern/instance_methods.rb