Class: Brainstem::ApiDocs::Formatters::Markdown::EndpointCollectionFormatter
- Inherits:
-
AbstractFormatter
- Object
- AbstractFormatter
- Brainstem::ApiDocs::Formatters::Markdown::EndpointCollectionFormatter
- Includes:
- Helper
- Defined in:
- lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb
Instance Attribute Summary collapse
-
#endpoint_collection ⇒ Object
Returns the value of attribute endpoint_collection.
-
#output ⇒ Object
Returns the value of attribute output.
-
#zero_text ⇒ Object
Returns the value of attribute zero_text.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(endpoint_collection, options = {}) ⇒ EndpointCollectionFormatter
constructor
Public API.
- #valid_options ⇒ Object
Methods included from Helper
#md_a, #md_code, #md_h1, #md_h2, #md_h3, #md_h4, #md_h5, #md_hr, #md_inline_code, #md_inline_type, #md_li, #md_p, #md_strong, #md_ul
Methods inherited from AbstractFormatter
Constructor Details
#initialize(endpoint_collection, options = {}) ⇒ EndpointCollectionFormatter
Public API
18 19 20 21 22 23 24 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 18 def initialize(endpoint_collection, = {}) self.endpoint_collection = endpoint_collection self.output = "" self.zero_text = "No endpoints were found." super end |
Instance Attribute Details
#endpoint_collection ⇒ Object
Returns the value of attribute endpoint_collection.
27 28 29 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 27 def endpoint_collection @endpoint_collection end |
#output ⇒ Object
Returns the value of attribute output.
27 28 29 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 27 def output @output end |
#zero_text ⇒ Object
Returns the value of attribute zero_text.
27 28 29 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 27 def zero_text @zero_text end |
Instance Method Details
#call ⇒ Object
37 38 39 40 41 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 37 def call format_endpoints! format_zero_text! if output.empty? output end |
#valid_options ⇒ Object
32 33 34 |
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_collection_formatter.rb', line 32 def super | [ :zero_text ] end |