Class: APIBlueprint::OutputCollector
- Inherits:
-
Object
- Object
- APIBlueprint::OutputCollector
- Defined in:
- lib/api_blueprint/output_collector.rb
Overview
Collects example for API documentation
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#resource_parameters ⇒ Object
Returns the value of attribute resource_parameters.
-
#resources ⇒ Object
Returns the value of attribute resources.
Instance Method Summary collapse
- #add_example(metadata, example_block, request, response) ⇒ Object
-
#initialize(configuration) ⇒ OutputCollector
constructor
A new instance of OutputCollector.
Constructor Details
#initialize(configuration) ⇒ OutputCollector
Returns a new instance of OutputCollector.
8 9 10 11 12 |
# File 'lib/api_blueprint/output_collector.rb', line 8 def initialize(configuration) @configuration = configuration @resources = {} @resource_parameters = {} end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/api_blueprint/output_collector.rb', line 6 def configuration @configuration end |
#resource_parameters ⇒ Object
Returns the value of attribute resource_parameters.
6 7 8 |
# File 'lib/api_blueprint/output_collector.rb', line 6 def resource_parameters @resource_parameters end |
#resources ⇒ Object
Returns the value of attribute resources.
6 7 8 |
# File 'lib/api_blueprint/output_collector.rb', line 6 def resources @resources end |
Instance Method Details
#add_example(metadata, example_block, request, response) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/api_blueprint/output_collector.rb', line 14 def add_example(, example_block, request, response) @resources.deep_merge!( [:resource_group] => build_resource(example_block, , request, response) ) end |