Class: RailsExceptionHandler::Configuration
- Inherits:
-
Object
- Object
- RailsExceptionHandler::Configuration
- Defined in:
- lib/rails_exception_handler/configuration.rb
Instance Attribute Summary collapse
-
#active_record_store_in ⇒ Object
Returns the value of attribute active_record_store_in.
-
#env_info_block ⇒ Object
Returns the value of attribute env_info_block.
-
#environments ⇒ Object
Returns the value of attribute environments.
-
#exception_info_block ⇒ Object
Returns the value of attribute exception_info_block.
-
#fallback_layout ⇒ Object
Returns the value of attribute fallback_layout.
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#global_info_block ⇒ Object
Returns the value of attribute global_info_block.
-
#mongoid_store_in ⇒ Object
Returns the value of attribute mongoid_store_in.
-
#request_info_block ⇒ Object
Returns the value of attribute request_info_block.
-
#response_mapping ⇒ Object
Returns the value of attribute response_mapping.
-
#responses ⇒ Object
Returns the value of attribute responses.
-
#storage_strategies ⇒ Object
Returns the value of attribute storage_strategies.
-
#store_user_info ⇒ Object
Returns the value of attribute store_user_info.
Instance Method Summary collapse
- #activate? ⇒ Boolean
- #active_record? ⇒ Boolean
- #after_initialize(&block) ⇒ Object
- #email? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #mongoid? ⇒ Boolean
- #run_callback ⇒ Object
- #store_environment_info(&block) ⇒ Object
- #store_exception_info(&block) ⇒ Object
- #store_global_info(&block) ⇒ Object
- #store_request_info(&block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rails_exception_handler/configuration.rb', line 4 def initialize @active_record_store_in = { database: 'exception_database', record_table: 'error_messages' } @environments = [:production] @storage_strategies = [] @filters = [] @store_user_info = false @fallback_layout = 'application' @response_mapping = {} @responses = {} end |
Instance Attribute Details
#active_record_store_in ⇒ Object
Returns the value of attribute active_record_store_in.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def active_record_store_in @active_record_store_in end |
#env_info_block ⇒ Object
Returns the value of attribute env_info_block.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def env_info_block @env_info_block end |
#environments ⇒ Object
Returns the value of attribute environments.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def environments @environments end |
#exception_info_block ⇒ Object
Returns the value of attribute exception_info_block.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def exception_info_block @exception_info_block end |
#fallback_layout ⇒ Object
Returns the value of attribute fallback_layout.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def fallback_layout @fallback_layout end |
#filters ⇒ Object
Returns the value of attribute filters.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def filters @filters end |
#global_info_block ⇒ Object
Returns the value of attribute global_info_block.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def global_info_block @global_info_block end |
#mongoid_store_in ⇒ Object
Returns the value of attribute mongoid_store_in.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def mongoid_store_in @mongoid_store_in end |
#request_info_block ⇒ Object
Returns the value of attribute request_info_block.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def request_info_block @request_info_block end |
#response_mapping ⇒ Object
Returns the value of attribute response_mapping.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def response_mapping @response_mapping end |
#responses ⇒ Object
Returns the value of attribute responses.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def responses @responses end |
#storage_strategies ⇒ Object
Returns the value of attribute storage_strategies.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def storage_strategies @storage_strategies end |
#store_user_info ⇒ Object
Returns the value of attribute store_user_info.
2 3 4 |
# File 'lib/rails_exception_handler/configuration.rb', line 2 def store_user_info @store_user_info end |
Instance Method Details
#activate? ⇒ Boolean
30 31 32 |
# File 'lib/rails_exception_handler/configuration.rb', line 30 def activate? environments.include?(Rails.env.to_sym) end |
#active_record? ⇒ Boolean
18 19 20 |
# File 'lib/rails_exception_handler/configuration.rb', line 18 def active_record? @storage_strategies.include?(:active_record) end |
#after_initialize(&block) ⇒ Object
34 35 36 |
# File 'lib/rails_exception_handler/configuration.rb', line 34 def after_initialize(&block) @callback = block end |
#email? ⇒ Boolean
26 27 28 |
# File 'lib/rails_exception_handler/configuration.rb', line 26 def email? @storage_strategies.collect{|s| s.is_a?(Hash) ? s.keys : s}.flatten.include?(:email) end |
#mongoid? ⇒ Boolean
22 23 24 |
# File 'lib/rails_exception_handler/configuration.rb', line 22 def mongoid? @storage_strategies.include?(:mongoid) end |
#run_callback ⇒ Object
38 39 40 |
# File 'lib/rails_exception_handler/configuration.rb', line 38 def run_callback @callback.call if(@callback) end |
#store_environment_info(&block) ⇒ Object
42 43 44 |
# File 'lib/rails_exception_handler/configuration.rb', line 42 def store_environment_info(&block) @env_info_block = block end |
#store_exception_info(&block) ⇒ Object
50 51 52 |
# File 'lib/rails_exception_handler/configuration.rb', line 50 def store_exception_info(&block) @exception_info_block = block end |
#store_global_info(&block) ⇒ Object
46 47 48 |
# File 'lib/rails_exception_handler/configuration.rb', line 46 def store_global_info(&block) @global_info_block = block end |
#store_request_info(&block) ⇒ Object
54 55 56 |
# File 'lib/rails_exception_handler/configuration.rb', line 54 def store_request_info(&block) @request_info_block = block end |