From 7b6c303239c367c77f36fa1c8f90717096a1888f Mon Sep 17 00:00:00 2001 From: Jason Draper Date: Fri, 24 Mar 2017 15:10:23 -0400 Subject: [PATCH] Fix 1.4 warnings --- lib/redbird/plug/session/redis.ex | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/redbird/plug/session/redis.ex b/lib/redbird/plug/session/redis.ex index 5e9a584..8762890 100644 --- a/lib/redbird/plug/session/redis.ex +++ b/lib/redbird/plug/session/redis.ex @@ -51,15 +51,12 @@ defmodule Plug.Session.REDIS do end defp add_namespace(key) do - namespace <> key + namespace() <> key end + @default_namespace "redbird_session_" def namespace do - Application.get_env(:redbird, :key_namespace, redbird_namespace) - end - - def redbird_namespace do - "redbird_session_" + Application.get_env(:redbird, :key_namespace, @default_namespace) end defp generate_random_key do @@ -76,17 +73,14 @@ end defmodule Redbird.RedisError do defexception [:message] + @base_message "Redbird was unable to store the session in redis." def raise([error: error, key: key]) do - message = "#{base_message} Redis Error: #{error} key: #{key}" + message = "#{@base_message} Redis Error: #{error} key: #{key}" raise __MODULE__, message end def exception(message) do %__MODULE__{message: message} end - - defp base_message do - "Redbird was unable to store the session in redis." - end end