Sha256: 36e0448008589b0b5c720f192ea96dfe2e32b3728c05fc6d946e152a59aef827

Contents?: true

Size: 903 Bytes

Versions: 1

Compression:

Stored size: 903 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    module DependencyContainer
      module Export
        include Support::Concern

        class_methods do
          ##
          # @param full_name [String, Symbol]
          # @param scope [:instance, :class]
          # @param body [Proc]
          # @return [ConvenientService::Support::DependencyContainer::Entities::Method]
          #
          def export(full_name, scope: Constants::DEFAULT_SCOPE, &body)
            Entities::Method.new(full_name: full_name, scope: scope, body: body).tap { |method| exported_methods << method }
          end

          ##
          # @return [ConvenientService::Support::DependencyContainer::Entities::MethodCollection]
          #
          def exported_methods
            @exported_methods ||= Entities::MethodCollection.new
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
convenient_service-0.5.0 lib/convenient_service/support/dependency_container/export.rb