Class: ConvenientService::Support::Middleware::StackBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/support/middleware/stack_builder.rb,
lib/convenient_service/support/middleware/stack_builder/constants.rb,
lib/convenient_service/support/middleware/stack_builder/exceptions.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/rack.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/rack/exceptions.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/ruby_middleware.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful/exceptions.rb

Defined Under Namespace

Modules: Constants, Entities, Exceptions

Class Method Summary collapse

Class Method Details

.by(backend) ⇒ Class

Parameters:

  • backend (Symbol)

Returns:

  • (Class)

Raises:



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/convenient_service/support/middleware/stack_builder.rb', line 24

def by(backend)
  case backend
  when Constants::Backends::RUBY_MIDDLEWARE
    Entities::Builders::RubyMiddleware
  when Constants::Backends::RACK
    Entities::Builders::Rack
  when Constants::Backends::STATEFUL
    Entities::Builders::Stateful
  else
    ::ConvenientService.raise Exceptions::NotSupportedBackend.new(backend: backend)
  end
end