Class: RailsAutodoc::Configuration
- Inherits:
-
Object
- Object
- RailsAutodoc::Configuration
- Defined in:
- lib/rails_autodoc/configuration.rb
Instance Attribute Summary collapse
-
#cache_spec_in_dev ⇒ Object
Returns the value of attribute cache_spec_in_dev.
-
#default_security ⇒ Object
Returns the value of attribute default_security.
-
#description ⇒ Object
Returns the value of attribute description.
-
#exclude_paths ⇒ Object
Returns the value of attribute exclude_paths.
-
#include_engines ⇒ Object
Returns the value of attribute include_engines.
-
#mount_path ⇒ Object
Returns the value of attribute mount_path.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#security_schemes ⇒ Object
Returns the value of attribute security_schemes.
-
#servers ⇒ Object
Returns the value of attribute servers.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #excluded_path?(path) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolved_output_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rails_autodoc/configuration.rb', line 17 def initialize @title = "Rails API" @version = "1.0.0" @description = "Auto-generated API documentation" @mount_path = "/api-docs" @output_path = nil @exclude_paths = [%r{^/rails/}, %r{^/api-docs}] @include_engines = [] @default_security = nil @cache_spec_in_dev = true @servers = [] @security_schemes = {} end |
Instance Attribute Details
#cache_spec_in_dev ⇒ Object
Returns the value of attribute cache_spec_in_dev.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def cache_spec_in_dev @cache_spec_in_dev end |
#default_security ⇒ Object
Returns the value of attribute default_security.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def default_security @default_security end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def description @description end |
#exclude_paths ⇒ Object
Returns the value of attribute exclude_paths.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def exclude_paths @exclude_paths end |
#include_engines ⇒ Object
Returns the value of attribute include_engines.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def include_engines @include_engines end |
#mount_path ⇒ Object
Returns the value of attribute mount_path.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def mount_path @mount_path end |
#output_path ⇒ Object
Returns the value of attribute output_path.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def output_path @output_path end |
#security_schemes ⇒ Object
Returns the value of attribute security_schemes.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def security_schemes @security_schemes end |
#servers ⇒ Object
Returns the value of attribute servers.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def servers @servers end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/rails_autodoc/configuration.rb', line 5 def version @version end |
Instance Method Details
#excluded_path?(path) ⇒ Boolean
31 32 33 |
# File 'lib/rails_autodoc/configuration.rb', line 31 def excluded_path?(path) exclude_paths.any? { |pattern| pattern.match?(path) } end |
#resolved_output_path ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/rails_autodoc/configuration.rb', line 35 def resolved_output_path return output_path if output_path if defined?(Rails) && Rails.respond_to?(:root) Rails.root.join("openapi/openapi.yaml") else Pathname.new("openapi/openapi.yaml") end end |