Class: SplititWebApiV4::OauthScopeOauth2

Inherits:
Object
  • Object
show all
Defined in:
lib/splitit_web_api_v4/models/oauth_scope_oauth_2.rb

Overview

OAuth 2 scopes supported by the API

Constant Summary collapse

OAUTH_SCOPE_OAUTH_2 =
[
  # Access to API v4
  API_V4 = 'api.v4'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = API_V4) ⇒ Object



20
21
22
23
24
# File 'lib/splitit_web_api_v4/models/oauth_scope_oauth_2.rb', line 20

def self.from_value(value, default_value = API_V4)
  return default_value if value.nil?

  default_value
end

.validate(value) ⇒ Object



14
15
16
17
18
# File 'lib/splitit_web_api_v4/models/oauth_scope_oauth_2.rb', line 14

def self.validate(value)
  return false if value.nil?

  OAUTH_SCOPE_OAUTH_2.include?(value)
end