Class: Socrates::Configuration
- Inherits:
-
Object
- Object
- Socrates::Configuration
- Defined in:
- lib/socrates/configuration.rb
Instance Attribute Summary collapse
-
#error_handler ⇒ Object
a callable like ->(String, Exception) { … }.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#expired_timeout ⇒ Object
seconds.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#view_path ⇒ Object
Returns the value of attribute view_path.
-
#warn_handler ⇒ Object
a callable like ->(String) { … }.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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 { |, _error| } # rubocop:disable Lint/EmptyBlock @warn_handler = proc { || } # rubocop:disable Lint/EmptyBlock end |
Instance Attribute Details
#error_handler ⇒ Object
a callable like ->(String, Exception) { … }
20 21 22 |
# File 'lib/socrates/configuration.rb', line 20 def error_handler @error_handler end |
#error_message ⇒ Object
Returns the value of attribute error_message.
17 18 19 |
# File 'lib/socrates/configuration.rb', line 17 def @error_message end |
#expired_timeout ⇒ Object
seconds
18 19 20 |
# File 'lib/socrates/configuration.rb', line 18 def expired_timeout @expired_timeout end |
#logger ⇒ Object
Returns the value of attribute logger.
19 20 21 |
# File 'lib/socrates/configuration.rb', line 19 def logger @logger end |
#storage ⇒ Object
Returns the value of attribute storage.
16 17 18 |
# File 'lib/socrates/configuration.rb', line 16 def storage @storage end |
#view_path ⇒ Object
Returns the value of attribute view_path.
15 16 17 |
# File 'lib/socrates/configuration.rb', line 15 def view_path @view_path end |
#warn_handler ⇒ Object
a callable like ->(String) { … }
21 22 23 |
# File 'lib/socrates/configuration.rb', line 21 def warn_handler @warn_handler end |