Class: SwaggerYard::Swagger
- Inherits:
-
Object
- Object
- SwaggerYard::Swagger
- Defined in:
- lib/swagger_yard/swagger.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#specification ⇒ Object
readonly
Returns the value of attribute specification.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(spec = Specification.new) ⇒ Swagger
constructor
A new instance of Swagger.
- #to_h ⇒ Object
Constructor Details
#initialize(spec = Specification.new) ⇒ Swagger
Returns a new instance of Swagger.
22 23 24 |
# File 'lib/swagger_yard/swagger.rb', line 22 def initialize(spec = Specification.new) @specification = spec end |
Instance Attribute Details
#specification ⇒ Object (readonly)
Returns the value of attribute specification.
20 21 22 |
# File 'lib/swagger_yard/swagger.rb', line 20 def specification @specification end |
Class Method Details
.new(*args) ⇒ Object
15 16 17 18 |
# File 'lib/swagger_yard/swagger.rb', line 15 def self.new(*args) return OpenAPI.object_new(*args) if SwaggerYard.config.swagger_version.start_with?("3.0") super end |
.object_new ⇒ Object
13 |
# File 'lib/swagger_yard/swagger.rb', line 13 alias object_new new |
Instance Method Details
#to_h ⇒ Object
26 27 28 |
# File 'lib/swagger_yard/swagger.rb', line 26 def to_h .merge(definitions).merge(model_definitions) end |