Skip to content

Commit

Permalink
Refactor setting instance variables in SwaggerDocsController
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuzanna Stolińska committed Aug 3, 2017
1 parent d188261 commit a3c984c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions app/controllers/swagger_ui_engine/swagger_docs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,15 @@ def single_doc
private

def set_configs
@doc_expansion = set_doc_expansion
@json_editor = set_json_editor
@model_rendering = set_model_rendering
@request_headers = set_request_headers
@swagger_url = set_swagger_url
@validator_url = set_validator_url
SwaggerUiEngine::DEFAULTS.keys.each do |key|
instance_variable_set("@#{key}", self.send("set_#{key}"))
end
end

def set_oauth_configs
@oauth_app_name = set_oauth_app_name
@oauth_client_id = set_oauth_client_id
@oauth_client_secret = set_oauth_client_secret
@oauth_realm = set_oauth_realm
@oauth_query_string_params = set_oauth_query_string_params
@oauth_scope_separator = set_oauth_scope_separator
SwaggerUiEngine::OAUTH2_DEFAULTS.keys.each do |key|
instance_variable_set("@#{key}", self.send("set_#{key}"))
end
end

def single_doc_url?
Expand Down

0 comments on commit a3c984c

Please sign in to comment.