35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/message_store/postgres/session.rb', line 35
def self.configure(receiver, session: nil, settings: nil, attr_name: nil)
attr_name ||= :session
if session != nil && settings != nil
error_msg = "Session configured with both settings and session arguments. Use one or the other, but not both."
logger.error(tag: :session) { error_msg }
raise Error, error_msg
end
instance = session || build(settings: settings)
receiver.public_send "#{attr_name}=", instance
instance
end
|