Module: Docit::DSL::ClassMethods
- Defined in:
- lib/docit/dsl.rb
Instance Method Summary collapse
Instance Method Details
#swagger_doc(action, &block) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/docit/dsl.rb', line 12 def swagger_doc(action, &block) operation = Operation.new( controller: name, action: action ) operation.instance_eval(&block) if block_given? Registry.register(operation) end |
#use_docs(doc_module) ⇒ Object
21 22 23 24 25 |
# File 'lib/docit/dsl.rb', line 21 def use_docs(doc_module) doc_module.actions.each do |action| swagger_doc(action, &doc_module[action]) end end |