Class: OasRails::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/oas_rails/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/oas_rails/configuration.rb', line 17

def initialize
  @info = Spec::Info.new
  @layout = false
  @servers = default_servers
  @tags = []
  @swagger_version = '3.1.0'
  @default_tags_from = :namespace
  @autodiscover_request_body = true
  @autodiscover_responses = true
  @api_path = "/"
  @ignored_actions = []
  @authenticate_all_routes_by_default = true
  @security_schema = nil
  @security_schemas = {}
  @set_default_responses = true
  @possible_default_responses = [:not_found, :unauthorized, :forbidden]
  @response_body_of_default = "Hash{ success: !Boolean, message: String }"
end

Instance Attribute Details

#api_pathObject

Returns the value of attribute api_path.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def api_path
  @api_path
end

#authenticate_all_routes_by_defaultObject

Returns the value of attribute authenticate_all_routes_by_default.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def authenticate_all_routes_by_default
  @authenticate_all_routes_by_default
end

#autodiscover_request_bodyObject

Returns the value of attribute autodiscover_request_body.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def autodiscover_request_body
  @autodiscover_request_body
end

#autodiscover_responsesObject

Returns the value of attribute autodiscover_responses.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def autodiscover_responses
  @autodiscover_responses
end

#default_tags_fromObject

Returns the value of attribute default_tags_from.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def default_tags_from
  @default_tags_from
end

#ignored_actionsObject

Returns the value of attribute ignored_actions.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def ignored_actions
  @ignored_actions
end

#infoObject

Returns the value of attribute info.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def info
  @info
end

#layoutObject

Returns the value of attribute layout.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def layout
  @layout
end

#possible_default_responsesObject

Returns the value of attribute possible_default_responses.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def possible_default_responses
  @possible_default_responses
end

#response_body_of_defaultObject

Returns the value of attribute response_body_of_default.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def response_body_of_default
  @response_body_of_default
end

#security_schemaObject

Returns the value of attribute security_schema.



15
16
17
# File 'lib/oas_rails/configuration.rb', line 15

def security_schema
  @security_schema
end

#security_schemasObject

Returns the value of attribute security_schemas.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def security_schemas
  @security_schemas
end

#serversObject

Returns the value of attribute servers.



15
16
17
# File 'lib/oas_rails/configuration.rb', line 15

def servers
  @servers
end

#set_default_responsesObject

Returns the value of attribute set_default_responses.



3
4
5
# File 'lib/oas_rails/configuration.rb', line 3

def set_default_responses
  @set_default_responses
end

#tagsObject

Returns the value of attribute tags.



15
16
17
# File 'lib/oas_rails/configuration.rb', line 15

def tags
  @tags
end

Instance Method Details

#default_serversObject



42
43
44
# File 'lib/oas_rails/configuration.rb', line 42

def default_servers
  [Spec::Server.new(url: "http://localhost:3000", description: "Rails Default Development Server")]
end

#excluded_columns_incomingObject



54
55
56
# File 'lib/oas_rails/configuration.rb', line 54

def excluded_columns_incoming
  %i[id created_at updated_at deleted_at]
end

#excluded_columns_outgoingObject



58
59
60
# File 'lib/oas_rails/configuration.rb', line 58

def excluded_columns_outgoing
  []
end