Class: Brainstem::ApiDocs::Formatters::OpenApiSpecification::Version2::EndpointFormatter
- Inherits:
-
AbstractFormatter
- Object
- AbstractFormatter
- Brainstem::ApiDocs::Formatters::OpenApiSpecification::Version2::EndpointFormatter
- Extended by:
- Forwardable
- Includes:
- Helper
- Defined in:
- lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#endpoint_key ⇒ Object
Returns the value of attribute endpoint_key.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#output ⇒ Object
Returns the value of attribute output.
-
#presenter ⇒ Object
Returns the value of attribute presenter.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(endpoint, options = {}) ⇒ EndpointFormatter
constructor
A new instance of EndpointFormatter.
Methods included from Helper
#format_description, #format_http_method, #format_tag_name, #presenter_title, #type_and_format, #uncapitalize
Methods inherited from AbstractFormatter
Methods included from Concerns::Optional
Constructor Details
#initialize(endpoint, options = {}) ⇒ EndpointFormatter
Returns a new instance of EndpointFormatter.
26 27 28 29 30 31 32 33 34 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 26 def initialize(endpoint, = {}) self.endpoint = endpoint self.presenter = endpoint.presenter self.endpoint_key = formatted_url self.http_method = format_http_method(endpoint) self.output = { endpoint_key => { http_method => {} } }.with_indifferent_access super end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
20 21 22 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 20 def endpoint @endpoint end |
#endpoint_key ⇒ Object
Returns the value of attribute endpoint_key.
20 21 22 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 20 def endpoint_key @endpoint_key end |
#http_method ⇒ Object
Returns the value of attribute http_method.
20 21 22 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 20 def http_method @http_method end |
#output ⇒ Object
Returns the value of attribute output.
20 21 22 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 20 def output @output end |
#presenter ⇒ Object
Returns the value of attribute presenter.
20 21 22 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 20 def presenter @presenter end |
Instance Method Details
#call ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/endpoint_formatter.rb', line 36 def call return {} if endpoint.nodoc? format_summary! format_optional_info! format_security! format_parameters! format_response! output end |