Class: RailsApiDocs::Configuration
- Inherits:
-
Object
- Object
- RailsApiDocs::Configuration
- Defined in:
- lib/rails-api-docs/configuration.rb
Instance Attribute Summary collapse
-
#api_only ⇒ Object
Returns the value of attribute api_only.
-
#config_path ⇒ Object
Returns the value of attribute config_path.
-
#ignored_actions ⇒ Object
Returns the value of attribute ignored_actions.
-
#ignored_controllers ⇒ Object
Returns the value of attribute ignored_controllers.
-
#ignored_path_prefixes ⇒ Object
Returns the value of attribute ignored_path_prefixes.
-
#mount_in_development ⇒ Object
Returns the value of attribute mount_in_development.
-
#mount_path ⇒ Object
Returns the value of attribute mount_path.
-
#only_controllers ⇒ Object
Returns the value of attribute only_controllers.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#route_source ⇒ Object
Default lazy lookup — resolved at call time so Rails.application is set by the time the generator runs.
-
#verbose_yaml ⇒ Object
Returns the value of attribute verbose_yaml.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rails-api-docs/configuration.rb', line 10 def initialize @config_path = "config/rails-api-docs.yml" @output_path = "public/api-docs.html" @mount_path = "/rails/api-docs" @mount_in_development = true @route_source = nil # User-extensible filters applied by RouteInspector. They stack on top # of the built-in INTERNAL_PREFIXES list — they don't replace it. # # ignored_* are blacklists. only_controllers is a whitelist. Strings # without "/" match by boundary-aware suffix (so "users" matches # `users` and `api/v1/users` but not `super_users`). Strings with "/" # match exactly. Regexps match via `Regexp#match?`. # Blacklist wins when a controller is in both lists. @ignored_path_prefixes = [] @ignored_controllers = [] @ignored_actions = [] @only_controllers = [] # When true, scaffold only includes routes whose controller is JSON-returning # (inherits from ActionController::API, or has `render json:` in the action body). # Can be set per-run via `rails g rails-api-docs:init --api-only` (or `:update`). @api_only = false # When true, scaffold emits EVERY possible YAML key per endpoint and field # (format, enum, default, min/max, pattern, read/write_only, nullable, # response headers/schema, etc.) with defaults — full discoverability at # the cost of much longer files. Default (false) emits only the commonly- # edited keys: description, example, and the existing inferred fields. # Per-run via `--verbose-yaml`. @verbose_yaml = false end |
Instance Attribute Details
#api_only ⇒ Object
Returns the value of attribute api_only.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def api_only @api_only end |
#config_path ⇒ Object
Returns the value of attribute config_path.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def config_path @config_path end |
#ignored_actions ⇒ Object
Returns the value of attribute ignored_actions.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def ignored_actions @ignored_actions end |
#ignored_controllers ⇒ Object
Returns the value of attribute ignored_controllers.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def ignored_controllers @ignored_controllers end |
#ignored_path_prefixes ⇒ Object
Returns the value of attribute ignored_path_prefixes.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def ignored_path_prefixes @ignored_path_prefixes end |
#mount_in_development ⇒ Object
Returns the value of attribute mount_in_development.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def mount_in_development @mount_in_development end |
#mount_path ⇒ Object
Returns the value of attribute mount_path.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def mount_path @mount_path end |
#only_controllers ⇒ Object
Returns the value of attribute only_controllers.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def only_controllers @only_controllers end |
#output_path ⇒ Object
Returns the value of attribute output_path.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def output_path @output_path end |
#route_source ⇒ Object
Default lazy lookup — resolved at call time so Rails.application is set by the time the generator runs. Tests can inject a custom RouteSet.
46 47 48 |
# File 'lib/rails-api-docs/configuration.rb', line 46 def route_source @route_source || Rails.application.routes end |
#verbose_yaml ⇒ Object
Returns the value of attribute verbose_yaml.
5 6 7 |
# File 'lib/rails-api-docs/configuration.rb', line 5 def verbose_yaml @verbose_yaml end |