Sha256: 4b72a5f5e5b4b83211130233e5dfeca246810523985450ae38b484b564ce243c

Contents?: true

Size: 1.61 KB

Versions: 8

Compression:

Stored size: 1.61 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module CanHaveSteps
        module Entities
          class Service
            module Concern
              module InstanceMethods
                include Support::Delegate

                ##
                # @return [ConvenientService::Service::Plugins::HasJSendResult::Entities::Result]
                #
                delegate :result, to: :klass

                ##
                # @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step]
                #
                delegate :step_class, to: :klass

                ##
                # @!attribute [r] klass
                #   @return [Class]
                #
                attr_reader :klass

                ##
                # @param klass [Class]
                #
                def initialize(klass)
                  @klass = klass
                end

                ##
                # @param method [String, Symbol]
                # @return [Boolean]
                #
                def has_defined_method?(method)
                  Utils::Method.defined?(method, klass, private: true)
                end

                ##
                # @param other [Object] Can be any type.
                # @return [Boolean, nil]
                #
                def ==(other)
                  casted = cast(other)

                  return unless casted

                  return false if klass != casted.klass

                  true
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.17.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.16.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.15.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.14.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb
convenient_service-0.13.0 lib/convenient_service/service/plugins/can_have_steps/entities/service/concern/instance_methods.rb