class RspecApiDocumentation::Writers::OpenApiExample

Public Class Methods

new(example) click to toggle source
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 219
def initialize(example)
  @example = example
end

Public Instance Methods

http_method() click to toggle source
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 231
def http_method
  metadata[:method]
end
method_missing(method, *args, &block) click to toggle source
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 223
def method_missing(method, *args, &block)
  @example.send(method, *args, &block)
end
requests() click to toggle source
Calls superclass method
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 235
def requests
  super.select { |request| request[:request_method].to_s.downcase == http_method.to_s.downcase }
end
respond_to?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 227
def respond_to?(method, include_private = false)
  super || @example.respond_to?(method, include_private)
end
route() click to toggle source
Calls superclass method
# File lib/rspec_api_documentation/writers/open_api_writer.rb, line 239
def route
  super.gsub(/:(?<parameter>[^\/]+)/, '{\k<parameter>}')
end