Class: Rack::JsonSchema::Docs::DocumentGenerator
- Inherits:
-
Object
- Object
- Rack::JsonSchema::Docs::DocumentGenerator
- Defined in:
- lib/rack/json_schema/docs.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Array
Generates suited response body from given env & document to docs request.
-
#initialize(app: nil, env: nil, html: nil, markdown: nil, path: nil) ⇒ DocumentGenerator
constructor
A new instance of DocumentGenerator.
Constructor Details
#initialize(app: nil, env: nil, html: nil, markdown: nil, path: nil) ⇒ DocumentGenerator
Returns a new instance of DocumentGenerator.
46 47 48 49 50 51 52 |
# File 'lib/rack/json_schema/docs.rb', line 46 def initialize(app: nil, env: nil, html: nil, markdown: nil, path: nil) @app = app @env = env @html = html @markdown = markdown @path = path end |
Class Method Details
.call(*args) ⇒ Object
37 38 39 |
# File 'lib/rack/json_schema/docs.rb', line 37 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Array
Generates suited response body from given env & document to docs request
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rack/json_schema/docs.rb', line 56 def call if has_docs_request? if has_markdown_request? markdown_response else html_response end else delegate end end |