Class: ApiSchema::Configuration
- Inherits:
-
Object
- Object
- ApiSchema::Configuration
- Includes:
- Swagger::Blocks::ClassMethods
- Defined in:
- lib/api_schema/configuration.rb
Instance Attribute Summary collapse
-
#authorization ⇒ Object
Returns the value of attribute authorization.
-
#base_path ⇒ Object
Returns the value of attribute base_path.
-
#consumes ⇒ Object
Returns the value of attribute consumes.
-
#contact_name ⇒ Object
Returns the value of attribute contact_name.
-
#description ⇒ Object
Returns the value of attribute description.
-
#descriptions_path ⇒ Object
Returns the value of attribute descriptions_path.
-
#error_desc ⇒ Object
Returns the value of attribute error_desc.
-
#error_model ⇒ Object
Returns the value of attribute error_model.
-
#host ⇒ Object
Returns the value of attribute host.
-
#produces ⇒ Object
Returns the value of attribute produces.
-
#terms_of_service ⇒ Object
Returns the value of attribute terms_of_service.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 |
# File 'lib/api_schema/configuration.rb', line 12 def initialize @error_model = 'error_model' @consumes = 'application/json' @produces = 'application/json' end |
Instance Attribute Details
#authorization ⇒ Object
Returns the value of attribute authorization.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def @authorization end |
#base_path ⇒ Object
Returns the value of attribute base_path.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def base_path @base_path end |
#consumes ⇒ Object
Returns the value of attribute consumes.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def consumes @consumes end |
#contact_name ⇒ Object
Returns the value of attribute contact_name.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def contact_name @contact_name end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def description @description end |
#descriptions_path ⇒ Object
Returns the value of attribute descriptions_path.
10 11 12 |
# File 'lib/api_schema/configuration.rb', line 10 def descriptions_path @descriptions_path end |
#error_desc ⇒ Object
Returns the value of attribute error_desc.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def error_desc @error_desc end |
#error_model ⇒ Object
Returns the value of attribute error_model.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def error_model @error_model end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def host @host end |
#produces ⇒ Object
Returns the value of attribute produces.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def produces @produces end |
#terms_of_service ⇒ Object
Returns the value of attribute terms_of_service.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def terms_of_service @terms_of_service end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/api_schema/configuration.rb', line 5 def version @version end |
Instance Method Details
#build ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/api_schema/configuration.rb', line 22 def build configuration = self swagger_root do key :swagger, '2.0' info do key :version, configuration.version key :title, configuration.title key :description, configuration.description key :termsOfService, configuration.terms_of_service contact do key :name, configuration.contact_name end end security_definition :authorization do key :name, :Authorization key :type, :apiKey key :in, :header end if configuration. key :host, configuration.host key :basePath, configuration.base_path key :consumes, configuration.consumes key :produces, configuration.produces end end |