Class: OmniAuth::Swagger::UIDOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/swagger/uid_options.rb

Constant Summary collapse

OPTION_API =
'api'.freeze
OPTION_API_PARAMS =
'api_params'.freeze
OPTION_PARAM =
'param'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apiObject

Returns the value of attribute api.



9
10
11
# File 'lib/omniauth/swagger/uid_options.rb', line 9

def api
  @api
end

#api_paramsObject

Returns the value of attribute api_params.



9
10
11
# File 'lib/omniauth/swagger/uid_options.rb', line 9

def api_params
  @api_params
end

#paramObject

Returns the value of attribute param.



9
10
11
# File 'lib/omniauth/swagger/uid_options.rb', line 9

def param
  @param
end

Class Method Details

.from_options(opts) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/omniauth/swagger/uid_options.rb', line 11

def self.from_options(opts)
  return nil if opts.nil?
  unless opts.kind_of?(Hash)
    opts = {OPTION_API => opts}
  end
  uid_options = new
  uid_options.api = opts[OPTION_API]
  uid_options.api_params = opts[OPTION_API_PARAMS]
  uid_options.param = opts[OPTION_PARAM]
  uid_options
end

Instance Method Details

#access_token_param?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/omniauth/swagger/uid_options.rb', line 27

def access_token_param?
  param != nil
end

#api?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/omniauth/swagger/uid_options.rb', line 23

def api?
  api != nil
end

#api_operationObject



35
36
37
# File 'lib/omniauth/swagger/uid_options.rb', line 35

def api_operation
  @api_operation ||= api.split("#").first
end

#api_value_pathObject



31
32
33
# File 'lib/omniauth/swagger/uid_options.rb', line 31

def api_value_path
  @api_value_path ||= api.split("#")[1]
end