Module: Docit::DSL::ClassMethods
- Defined in:
- lib/docit/dsl.rb
Instance Method Summary collapse
- #doc_for(action, &block) ⇒ Object (also: #swagger_doc)
- #use_docs(doc_module) ⇒ Object
Instance Method Details
#doc_for(action, &block) ⇒ Object Also known as: swagger_doc
12 13 14 15 16 17 18 19 |
# File 'lib/docit/dsl.rb', line 12 def doc_for(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
24 25 26 27 28 |
# File 'lib/docit/dsl.rb', line 24 def use_docs(doc_module) doc_module.actions.each do |action| doc_for(action, &doc_module[action]) end end |