Module: TpagaService::Swagger
- Defined in:
- lib/tpaga_service/swagger.rb,
lib/tpaga_service/swagger/request.rb,
lib/tpaga_service/swagger/response.rb,
lib/tpaga_service/swagger/configuration.rb
Defined Under Namespace
Classes: Configuration, Request, Response
Class Attribute Summary collapse
-
.configuration ⇒ Object
A Swagger configuration object.
Class Method Summary collapse
-
.configure {|configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
Class Attribute Details
.configuration ⇒ Object
A Swagger configuration object. Must act like a hash and return sensible values for all Swagger configuration options. See Swagger::Configuration.
11 12 13 |
# File 'lib/tpaga_service/swagger.rb', line 11 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
Call this method to modify defaults in your initializers.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/tpaga_service/swagger.rb', line 22 def configure yield(configuration) if block_given? # Configure logger. Default to use Rails # self.logger ||= configuration.logger || (defined?(Rails) ? Rails.logger : Logger.new(STDOUT)) # remove :// from scheme # configuration.scheme.sub!(/:\/\//, '') # remove http(s):// and anything after a slash configuration.host.sub!(/https?:\/\//, '') configuration.host = configuration.host.split('/').first # Add leading and trailing slashes to base_path configuration.base_path = "/#{configuration.base_path}".gsub(/\/+/, '/') configuration.base_path = "" if configuration.base_path == "/" end |