Class: RspecApiDocs::Renderer::JSONRenderer::ExampleSerializer
- Inherits:
-
Object
- Object
- RspecApiDocs::Renderer::JSONRenderer::ExampleSerializer
- Defined in:
- lib/rspec_api_docs/formatter/renderer/json_renderer/example_serializer.rb
Instance Attribute Summary collapse
-
#example ⇒ Object
readonly
Returns the value of attribute example.
Instance Method Summary collapse
-
#initialize(example) ⇒ ExampleSerializer
constructor
A new instance of ExampleSerializer.
- #to_h ⇒ Object
Constructor Details
#initialize(example) ⇒ ExampleSerializer
Returns a new instance of ExampleSerializer.
7 8 9 |
# File 'lib/rspec_api_docs/formatter/renderer/json_renderer/example_serializer.rb', line 7 def initialize(example) @example = example end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
5 6 7 |
# File 'lib/rspec_api_docs/formatter/renderer/json_renderer/example_serializer.rb', line 5 def example @example end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rspec_api_docs/formatter/renderer/json_renderer/example_serializer.rb', line 11 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 |