Class: NetboxClientRuby::Secrets::SessionKey

Inherits:
Object
  • Object
show all
Includes:
Communication
Defined in:
lib/netbox_client_ruby/api/secrets/session_key.rb

Constant Summary collapse

PATH =
'/api/secrets/get-session-key/'.freeze

Instance Method Summary collapse

Methods included from Communication

#hash_to_object, #response

Constructor Details

#initializeSessionKey

Returns a new instance of SessionKey.



10
11
12
# File 'lib/netbox_client_ruby/api/secrets/session_key.rb', line 10

def initialize
  session_key
end

Instance Method Details

#reloadObject



18
19
20
# File 'lib/netbox_client_ruby/api/secrets/session_key.rb', line 18

def reload
  NetboxClientRuby::Secrets.session_key = request['session_key']
end

#session_keyObject



14
15
16
# File 'lib/netbox_client_ruby/api/secrets/session_key.rb', line 14

def session_key
  NetboxClientRuby::Secrets.session_key ||= request['session_key']
end