Sha256: 2f579e8c70af7fa99fd022f0b2b3b08758bb0d3d1ab87de80ffbd9167eb39d17

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    module DependencyContainer
      module Commands
        class AssertValidScope < Support::Command
          ##
          # @!attribute [r] scope
          #   @return [Symbol]
          #
          attr_reader :scope

          ##
          # @param scope [Symbol]
          # @return [void]
          #
          def initialize(scope:)
            @scope = scope
          end

          ##
          # @return [void]
          # @raise [ConvenientService::Support::DependencyContainer::Exceptions::InvalidScope]
          #
          def call
            ::ConvenientService.raise Exceptions::InvalidScope.new(scope: scope) unless Constants::SCOPES.include?(scope)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb
convenient_service-0.19.0 lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb
convenient_service-0.18.0 lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb
convenient_service-0.17.0 lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb