Apply Layout/LineLength rubocop rule

Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
This commit is contained in:
Javi Martín
2023-07-19 21:37:59 +02:00
parent 75d2782061
commit a1439d0790
156 changed files with 1330 additions and 503 deletions

View File

@@ -1,6 +1,10 @@
class ManagerAuthenticator
def initialize(data = {})
@manager = { login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion] }.with_indifferent_access
@manager = {
login: data[:login],
user_key: data[:clave_usuario],
date: data[:fecha_conexion]
}.with_indifferent_access
end
def auth
@@ -13,7 +17,11 @@ class ManagerAuthenticator
private
def manager_exists?
response = client.call(:get_status_user_data, message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }}).body
response = client.call(
:get_status_user_data,
message: { ub: { user_key: @manager[:user_key], date: @manager[:date] }}
).body
parsed_response = parser.parse((response[:get_status_user_data_response][:get_status_user_data_return]))
@manager[:login] == parsed_response["USUARIO"]["LOGIN"]
rescue
@@ -21,13 +29,17 @@ class ManagerAuthenticator
end
def application_authorized?
response = client.call(:get_applications_user_list, message: { ub: { user_key: @manager[:user_key] }}).body
response = client.call(
:get_applications_user_list,
message: { ub: { user_key: @manager[:user_key] }}
).body
user_list_return = response[:get_applications_user_list_response][:get_applications_user_list_return]
parsed_response = parser.parse(user_list_return)
aplication_value = parsed_response["APLICACIONES"]["APLICACION"]
# aplication_value from UWEB can be an array of hashes or a hash
aplication_value.include?("CLAVE_APLICACION" => application_key) || aplication_value["CLAVE_APLICACION"] == application_key
aplication_value.include?("CLAVE_APLICACION" => application_key) ||
aplication_value["CLAVE_APLICACION"] == application_key
rescue
false
end