Class: Rodauth::Generators::OpenAPIGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Rodauth::Generators::OpenAPIGenerator
- Defined in:
- lib/generators/rodauth/openapi_generator.rb
Instance Method Summary collapse
Instance Method Details
#print_documentation ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/generators/rodauth/openapi_generator.rb', line 24 def print_documentation open_api = Rodauth::OpenAPI.new(auth_class, password: [:password], json: [:json]) documentation = open_api.public_send(:"to_#{[:format]}") if [:save] File.write([:save], documentation) else puts documentation end rescue Rodauth::OpenAPI::Error => error say error., :red end |