Class: Grape::API
- Inherits:
-
Object
- Object
- Grape::API
- Defined in:
- lib/grape-swagger.rb
Class Attribute Summary collapse
-
.combined_namespace_identifiers ⇒ Object
Returns the value of attribute combined_namespace_identifiers.
-
.combined_namespace_routes ⇒ Object
Returns the value of attribute combined_namespace_routes.
-
.combined_namespaces ⇒ Object
Returns the value of attribute combined_namespaces.
-
.combined_routes ⇒ Object
Returns the value of attribute combined_routes.
Class Method Summary collapse
Class Attribute Details
.combined_namespace_identifiers ⇒ Object
Returns the value of attribute combined_namespace_identifiers.
16 17 18 |
# File 'lib/grape-swagger.rb', line 16 def combined_namespace_identifiers @combined_namespace_identifiers end |
.combined_namespace_routes ⇒ Object
Returns the value of attribute combined_namespace_routes.
16 17 18 |
# File 'lib/grape-swagger.rb', line 16 def combined_namespace_routes @combined_namespace_routes end |
.combined_namespaces ⇒ Object
Returns the value of attribute combined_namespaces.
16 17 18 |
# File 'lib/grape-swagger.rb', line 16 def combined_namespaces @combined_namespaces end |
.combined_routes ⇒ Object
Returns the value of attribute combined_routes.
16 17 18 |
# File 'lib/grape-swagger.rb', line 16 def combined_routes @combined_routes end |
Class Method Details
.add_swagger_documentation(options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/grape-swagger.rb', line 18 def add_swagger_documentation( = {}) documentation_class = create_documentation_class version_for() = { target_class: self }.merge() @target_class = [:target_class] documentation_class.setup() mount(documentation_class) @target_class.combined_routes = {} combine_routes(@target_class, documentation_class) @target_class.combined_namespaces = {} combine_namespaces(@target_class) @target_class.combined_namespace_routes = {} @target_class.combined_namespace_identifiers = {} combine_namespace_routes(@target_class.combined_namespaces) exclusive_route_keys = @target_class.combined_routes.keys - @target_class.combined_namespaces.keys exclusive_route_keys.each { |key| @target_class.combined_namespace_routes[key] = @target_class.combined_routes[key] } documentation_class end |