Module: Apicraft::Concerns::MiddlewareUtil

Included in:
Middlewares::Introspector, Middlewares::Mocker, Middlewares::RequestValidator
Defined in:
lib/apicraft/concerns/middleware_util.rb

Overview

Helper class with shared methods

Instance Method Summary collapse

Instance Method Details

#configObject



7
8
9
# File 'lib/apicraft/concerns/middleware_util.rb', line 7

def config
  @config ||= Apicraft.config
end

#convertor(format) ⇒ Object



11
12
13
14
15
# File 'lib/apicraft/concerns/middleware_util.rb', line 11

def convertor(format)
  return if format.blank?

  Apicraft::Constants::MIME_TYPE_CONVERTORS[format]
end