Class: Webspicy::Web::Openapi::Generator
- Inherits:
-
Object
- Object
- Webspicy::Web::Openapi::Generator
- Defined in:
- lib/webspicy/web/openapi/generator.rb
Constant Summary collapse
- DEFAULT_OPENAPI =
{ openapi: '3.0.2', info: { version: '1.0.0', title: 'Webspicy Specification' } }
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
Instance Method Summary collapse
- #call(info = {}) ⇒ Object
-
#initialize(config) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(config) ⇒ Generator
Returns a new instance of Generator.
16 17 18 19 20 21 |
# File 'lib/webspicy/web/openapi/generator.rb', line 16 def initialize(config) @config = Configuration.dress(config) @generator = config.generator || Finitio::Generation.new( collection_size: 1..1 ) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
22 23 24 |
# File 'lib/webspicy/web/openapi/generator.rb', line 22 def config @config end |
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
22 23 24 |
# File 'lib/webspicy/web/openapi/generator.rb', line 22 def generator @generator end |
Instance Method Details
#call(info = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/webspicy/web/openapi/generator.rb', line 24 def call(info = {}) base = Support::DeepMerge.deep_merge( DEFAULT_OPENAPI, base_openapi ) Support::DeepMerge.deep_merge( base, { info: info, tags: , paths: paths } ) end |