Module: Useless::Doc::Sinatra
- Defined in:
- lib/useless/doc/sinatra.rb
Instance Method Summary collapse
-
#doc(path, &block) ⇒ Object
Provides access to the
Doc::DSL
.
Instance Method Details
#doc(path, &block) ⇒ Object
Provides access to the Doc::DSL
. The JSON of the resource that is created will then be served via an OPTIONS request to the specified path
.
37 38 39 40 41 42 43 |
# File 'lib/useless/doc/sinatra.rb', line 37 def doc(path, &block) resource = Useless::Doc::DSL::Resource.build path: path, &block (path) do Doc::Serialization::Dump.resource(resource) end end |