Module: Swagger::Docs::Methods::ClassMethods
- Defined in:
- lib/swagger/docs/methods.rb
Instance Method Summary collapse
- #swagger_actions ⇒ Object
- #swagger_config ⇒ Object
- #swagger_controller(controller, description) ⇒ Object
- #swagger_models ⇒ Object
Instance Method Details
#swagger_actions ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/swagger/docs/methods.rb', line 14 def swagger_actions swagger_dsl = {} Array(@swagger_dsl).each do |action, controller, block| dsl = SwaggerDSL.call(action, controller, &block) swagger_dsl[action] ||= {} swagger_dsl[action].deep_merge!(dsl) { |key, old, new| Array(old) + Array(new) } end swagger_dsl end |
#swagger_config ⇒ Object
33 34 35 |
# File 'lib/swagger/docs/methods.rb', line 33 def swagger_config @swagger_config ||= {} end |
#swagger_controller(controller, description) ⇒ Object
9 10 11 12 |
# File 'lib/swagger/docs/methods.rb', line 9 def swagger_controller(controller, description) swagger_config[:controller] = controller swagger_config[:description] = description end |
#swagger_models ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/swagger/docs/methods.rb', line 24 def swagger_models swagger_model_dsls ||= {} Array(@swagger_model_dsls).each do |model_name, controller, block| model_dsl = SwaggerModelDSL.call(model_name, controller, &block) swagger_model_dsls[model_name] = model_dsl end swagger_model_dsls end |