Class: SwaggerPetstoreOpenApi30::OAuthScopePetstoreAuthEnum
- Inherits:
-
Object
- Object
- SwaggerPetstoreOpenApi30::OAuthScopePetstoreAuthEnum
- Defined in:
- lib/swagger_petstore_open_api30/models/o_auth_scope_petstore_auth_enum.rb
Overview
OAuth 2 scopes supported by the API
Constant Summary collapse
- O_AUTH_SCOPE_PETSTORE_AUTH_ENUM =
[ # modify pets in your account WRITEPETS = 'write:pets'.freeze, # read your pets READPETS = 'read:pets'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = WRITEPETS) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/swagger_petstore_open_api30/models/o_auth_scope_petstore_auth_enum.rb', line 23 def self.from_value(value, default_value = WRITEPETS) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'writepets' then WRITEPETS when 'readpets' then READPETS else default_value end end |
.validate(value) ⇒ Object
17 18 19 20 21 |
# File 'lib/swagger_petstore_open_api30/models/o_auth_scope_petstore_auth_enum.rb', line 17 def self.validate(value) return false if value.nil? O_AUTH_SCOPE_PETSTORE_AUTH_ENUM.include?(value) end |