Class: ConvenientService::Support::DependencyContainer::Commands::AssertValidScope

Inherits:
Command
  • Object
show all
Defined in:
lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

[], call

Constructor Details

#initialize(scope:) ⇒ void

Parameters:

  • scope (Symbol)


23
24
25
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb', line 23

def initialize(scope:)
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



17
18
19
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb', line 17

def scope
  @scope
end

Instance Method Details

#callvoid

This method returns an undefined value.



31
32
33
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb', line 31

def call
  ::ConvenientService.raise Exceptions::InvalidScope.new(scope: scope) unless Constants::SCOPES.include?(scope)
end