Class: Socrates::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/socrates/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



23
24
25
26
27
28
29
30
# File 'lib/socrates/configuration.rb', line 23

def initialize
  @storage         = Storage::Memory.new
  @error_message   = "Sorry, something went wrong. We'll have to start over..."
  @expired_timeout = 30.minutes
  @logger          = Socrates::Logger.default
  @error_handler   = proc { |_message, _error| } # rubocop:disable Lint/EmptyBlock
  @warn_handler    = proc { |_message| } # rubocop:disable Lint/EmptyBlock
end

Instance Attribute Details

#error_handlerObject

a callable like ->(String, Exception) { … }



20
21
22
# File 'lib/socrates/configuration.rb', line 20

def error_handler
  @error_handler
end

#error_messageObject

Returns the value of attribute error_message.



17
18
19
# File 'lib/socrates/configuration.rb', line 17

def error_message
  @error_message
end

#expired_timeoutObject

seconds



18
19
20
# File 'lib/socrates/configuration.rb', line 18

def expired_timeout
  @expired_timeout
end

#loggerObject

Returns the value of attribute logger.



19
20
21
# File 'lib/socrates/configuration.rb', line 19

def logger
  @logger
end

#storageObject

Returns the value of attribute storage.



16
17
18
# File 'lib/socrates/configuration.rb', line 16

def storage
  @storage
end

#view_pathObject

Returns the value of attribute view_path.



15
16
17
# File 'lib/socrates/configuration.rb', line 15

def view_path
  @view_path
end

#warn_handlerObject

a callable like ->(String) { … }



21
22
23
# File 'lib/socrates/configuration.rb', line 21

def warn_handler
  @warn_handler
end