Method: AruxApp::API::Auth#initialize

Defined in:
lib/arux_app/api/auth.rb

#initialize(options = {}) ⇒ Auth

Returns a new instance of Auth.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/arux_app/api/auth.rb', line 31

def initialize(options = {})
  self.client_id = options[:client_id]
  self.client_secret = options[:client_secret]
  self.redirect_uri = options[:redirect_uri]
  self.js_callback = options[:js_callback]
  self. = options[:login_mechanism] || 'redirect'
  self.element = options[:element]
  self.district_subdomain = options[:district_subdomain]
  self.current_user_uuid = options[:current_user_uuid]

  raise API::InitializerError.new(:client_id, "can't be blank") if self.client_id.to_s.empty?
  raise API::InitializerError.new(:client_secret, "can't be blank") if self.client_secret.to_s.empty?
  raise API::InitializerError.new(:redirect_uri, "can't be blank") if self.redirect_uri.to_s.empty?
end