Class: Openapi::Rswag::Ui::Configuration
- Inherits:
-
Object
- Object
- Openapi::Rswag::Ui::Configuration
- Defined in:
- lib/openapi/rswag/ui/configuration.rb
Instance Attribute Summary collapse
-
#assets_root ⇒ Object
readonly
Returns the value of attribute assets_root.
-
#config_object ⇒ Object
Returns the value of attribute config_object.
-
#oauth_config_object ⇒ Object
Returns the value of attribute oauth_config_object.
-
#template_locations ⇒ Object
readonly
Returns the value of attribute template_locations.
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #swagger_endpoint(url, name) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 12 def initialize @template_locations = [ # preffered override location "#{Rack::Directory.new('').root}/swagger/index.erb", # backwards compatible override location "#{Rack::Directory.new('').root}/app/views/rswag/ui/home/index.html.erb", # default location File.('../index.erb', __FILE__) ] @assets_root = File.('../../../../../node_modules/swagger-ui-dist', __FILE__) @config_object = {} @oauth_config_object = {} end |
Instance Attribute Details
#assets_root ⇒ Object (readonly)
Returns the value of attribute assets_root.
10 11 12 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 10 def assets_root @assets_root end |
#config_object ⇒ Object
Returns the value of attribute config_object.
8 9 10 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 8 def config_object @config_object end |
#oauth_config_object ⇒ Object
Returns the value of attribute oauth_config_object.
9 10 11 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 9 def oauth_config_object @oauth_config_object end |
#template_locations ⇒ Object (readonly)
Returns the value of attribute template_locations.
7 8 9 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 7 def template_locations @template_locations end |
Instance Method Details
#get_binding ⇒ Object
31 32 33 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 31 def get_binding binding end |
#swagger_endpoint(url, name) ⇒ Object
26 27 28 29 |
# File 'lib/openapi/rswag/ui/configuration.rb', line 26 def swagger_endpoint(url, name) @config_object[:urls] ||= [] @config_object[:urls] << { url: url, name: name } end |