module RspecApiDocumentation::DSL

Public Instance Methods

resource(*args, &block) click to toggle source

Custom describe block that sets metadata to enable the rest of RAD

resource "Orders", :meta => :data do
  # ...
end

Params:

args

Glob of RSpec's `describe` arguments

block

Block to pass into describe

# File lib/rspec_api_documentation/dsl.rb, line 20
def resource(*args, &block)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options[:api_doc_dsl] = :resource
  options[:resource_name] = args.first.to_s
  options[:document] = :all unless options.key?(:document)
  args.push(options)
  describe(*args, &block)
end