Class: Brainstem::ApiDocs::Formatters::OpenApiSpecification::Version2::TagsFormatter
- Inherits:
-
AbstractFormatter
- Object
- AbstractFormatter
- Brainstem::ApiDocs::Formatters::OpenApiSpecification::Version2::TagsFormatter
- Includes:
- Helper
- Defined in:
- lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb
Instance Attribute Summary collapse
-
#controllers ⇒ Object
Returns the value of attribute controllers.
-
#ignore_tagging ⇒ Object
Returns the value of attribute ignore_tagging.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(controllers, options = {}) ⇒ TagsFormatter
constructor
A new instance of TagsFormatter.
-
#valid_options ⇒ Object
Declares the options that are permissable to set on this instance.
Methods included from Helper
#format_description, #format_http_method, #format_tag_name, #presenter_title, #type_and_format, #uncapitalize
Methods inherited from AbstractFormatter
Constructor Details
#initialize(controllers, options = {}) ⇒ TagsFormatter
Returns a new instance of TagsFormatter.
26 27 28 29 30 31 32 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 26 def initialize(controllers, = {}) self.output = ActiveSupport::HashWithIndifferentAccess.new self.controllers = controllers self.ignore_tagging = false super end |
Instance Attribute Details
#controllers ⇒ Object
Returns the value of attribute controllers.
22 23 24 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 22 def controllers @controllers end |
#ignore_tagging ⇒ Object
Returns the value of attribute ignore_tagging.
22 23 24 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 22 def ignore_tagging @ignore_tagging end |
#output ⇒ Object
Returns the value of attribute output.
22 23 24 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 22 def output @output end |
Instance Method Details
#call ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 34 def call return {} if ignore_tagging || controllers.blank? format_tag_groups! output end |
#valid_options ⇒ Object
Declares the options that are permissable to set on this instance.
15 16 17 18 19 20 |
# File 'lib/brainstem/api_docs/formatters/open_api_specification/version_2/tags_formatter.rb', line 15 def super | [ :controllers, :ignore_tagging ] end |