Class: AruxApp::API::Nav

Inherits:
Object
  • Object
show all
Defined in:
lib/arux_app/api/nav.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Nav

Returns a new instance of Nav.



7
8
9
10
11
12
# File 'lib/arux_app/api/nav.rb', line 7

def initialize(options = {})
  self.auth = options[:auth]

  raise API::InitializerError.new(:auth, "can't be blank") if self.auth.nil?
  raise API::InitializerError.new(:auth, "must be of class type AruxApp::API::Auth") if !self.auth.is_a?(AruxApp::API::Auth)
end

Instance Attribute Details

#authObject

Returns the value of attribute auth.



5
6
7
# File 'lib/arux_app/api/nav.rb', line 5

def auth
  @auth
end

Instance Method Details

#javascriptObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/arux_app/api/nav.rb', line 14

def javascript
  options = {
    district: self.auth.district_subdomain,
    login: {
      current_uuid: self.auth.current_user_uuid,
      client_id: self.auth.client_id,
      redirect_uri: self.auth.redirect_uri,
      callback: self.auth.js_callback
    }
  }
  return %(new SwitchBoardIONav(#{options.to_json});)
end