Method: BimsApiClient#login

Defined in:
lib/bims_api_client.rb

#login(username = (@configuration.username), password = (@configuration.password)) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/bims_api_client.rb', line 64

def (username = (@configuration.username), password = (@configuration.password))
  success = false
  begin
    return false if not_initialized?
    response_object = (username, password)
    if response_object[@configuration.status_key] == @configuration.status_value_ok
      @redis.set('bims_sid', response_object[@configuration.data_key][@configuration.data_session_key][@configuration.data_session_id_key].to_s)
      success = true
    end
  rescue => e
    puts e.to_s #debug the error
  end
  return success
end