Class: ConvenientService::Support::DependencyContainer::Commands::AssertValidMethod

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

[], call

Constructor Details

#initialize(slug:, scope:, container:) ⇒ void

Parameters:

  • slug (String, Symbol)
  • scope (Symbol)
  • container (Module)


32
33
34
35
36
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb', line 32

def initialize(slug:, scope:, container:)
  @slug = slug
  @scope = scope
  @container = container
end

Instance Attribute Details

#containerObject (readonly)

Returns the value of attribute container.



24
25
26
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb', line 24

def container
  @container
end

#scopeObject (readonly)

Returns the value of attribute scope.



18
19
20
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb', line 18

def scope
  @scope
end

#slugObject (readonly)

Returns the value of attribute slug.



12
13
14
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb', line 12

def slug
  @slug
end

Instance Method Details

#callvoid

This method returns an undefined value.



42
43
44
# File 'lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb', line 42

def call
  ::ConvenientService.raise Exceptions::NotExportedMethod.new(method_name: slug, method_scope: scope, mod: container) unless method
end