Module: Tina4::Swagger
- Defined in:
- lib/tina4/swagger.rb
Class Method Summary collapse
-
.enabled? ⇒ Boolean
TINA4_SWAGGER_ENABLED — defaults to TINA4_DEBUG.
- .generate(routes = []) ⇒ Object
Class Method Details
.enabled? ⇒ Boolean
TINA4_SWAGGER_ENABLED — defaults to TINA4_DEBUG. When false, callers can choose to skip mounting /swagger entirely in production.
18 19 20 21 22 23 24 |
# File 'lib/tina4/swagger.rb', line 18 def enabled? explicit = ENV["TINA4_SWAGGER_ENABLED"] if explicit && !explicit.empty? return %w[true 1 yes on].include?(explicit.to_s.strip.downcase) end %w[true 1 yes on].include?(ENV.fetch("TINA4_DEBUG", "").to_s.strip.downcase) end |