Sha256: 408c8e7734d8437415b83a603e7c2b2282c88c505e9833ddeb7d3830c4c57aac
Contents?: true
Size: 1.15 KB
Versions: 12
Compression:
Stored size: 1.15 KB
Contents
module RspecApiDocs module Renderer class JSONRenderer class ExampleSerializer attr_reader :example def initialize(example) @example = example end def to_h { description: example.description, name: example.name, http_method: example.http_method, parameters: parameters, path: example.path, requests: example.requests, response_fields: response_fields, notes: example.notes, } end private def parameters example.parameters.map do |parameter| { name: Name.(name: parameter.name, scope: parameter.scope), description: parameter.description, required: parameter.required, } end end def response_fields example.response_fields.map do |field| { name: Name.(name: field.name, scope: field.scope), description: field.description, type: field.type, } end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems