Class: RubyAPI::OpenAPI
- Inherits:
-
Object
- Object
- RubyAPI::OpenAPI
- Defined in:
- lib/fastrb/openapi.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(app) ⇒ OpenAPI
constructor
A new instance of OpenAPI.
- #to_json ⇒ Object
Constructor Details
#initialize(app) ⇒ OpenAPI
Returns a new instance of OpenAPI.
5 6 7 |
# File 'lib/fastrb/openapi.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#generate ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fastrb/openapi.rb', line 9 def generate { openapi: "3.0.0", info: { title: "FastRb App", version: "0.1.0" }, paths: generate_paths } end |
#to_json ⇒ Object
20 21 22 |
# File 'lib/fastrb/openapi.rb', line 20 def to_json JSON.pretty_generate(generate) end |