Sha256: 1e0a738cb598931928cf6703cf60586787742685ca7ae3ea6bc3905c872910fb

Contents?: true

Size: 1.06 KB

Versions: 13

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require_relative "service/class_methods"

module ConvenientService
  module Service
    module Plugins
      module HasResultSteps
        module Entities
          ##
          # NOTE: Service is a wrapper for a service class (klass). For example:
          #
          #   step SomeService, in: :foo, out: :bar
          #   # klass is `SomeService` in this particular case.
          #
          class Service
            include Support::Castable
            include Support::Delegate

            extend ClassMethods

            delegate :result, :step_class, to: :klass

            attr_reader :klass

            def initialize(klass)
              @klass = klass
            end

            def has_defined_method?(method)
              Utils::Method.defined?(method, klass, private: true)
            end

            def ==(other)
              casted = cast(other)

              return unless casted

              return false if klass != casted.klass

              true
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
convenient_service-0.10.1 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.10.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.9.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.8.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.7.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.6.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb
convenient_service-0.1.0 lib/convenient_service/service/plugins/has_result_steps/entities/service.rb