Class: Swagger::DSL
- Inherits:
-
Hash
- Object
- Hash
- Swagger::DSL
- Includes:
- ResolveModule
- Defined in:
- lib/swagger/dsl.rb,
lib/swagger/dsl/config.rb,
lib/swagger/dsl/version.rb,
lib/swagger/dsl/operation.rb,
lib/swagger/dsl/parameter.rb,
lib/swagger/dsl/components.rb,
lib/swagger/dsl/parameters.rb,
lib/swagger/dsl/serializer.rb,
lib/swagger/dsl/json_schema.rb,
lib/swagger/dsl/resolve_module.rb,
lib/swagger/dsl/rails_controller.rb,
lib/swagger/dsl/json_schema/jimmy.rb,
lib/swagger/dsl/parameters_in_type.rb,
lib/swagger/dsl/json_schema/subset_dsl.rb
Defined Under Namespace
Modules: RailsController, ResolveModule, Serializer Classes: Components, Config, JsonSchema, Operation, Parameter, Parameters, ParametersInType
Constant Summary collapse
- VERSION =
"1.3.0".freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schema = nil, config: Config.new) ⇒ DSL
constructor
A new instance of DSL.
Methods included from ResolveModule
#resolve, #resolved, #resolver
Constructor Details
#initialize(schema = nil, config: Config.new) ⇒ DSL
Returns a new instance of DSL.
20 21 22 23 24 25 26 27 |
# File 'lib/swagger/dsl.rb', line 20 def initialize(schema = nil, config: Config.new) merge!(schema || {}) self["openapi"] ||= "3.0.0" self["info"] ||= {} self["paths"] ||= {} self["components"] = Components[self["components"] || {}] @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
18 19 20 |
# File 'lib/swagger/dsl.rb', line 18 def config @config end |
Class Method Details
.current ⇒ Object
13 14 15 |
# File 'lib/swagger/dsl.rb', line 13 def current @current ||= new end |