Class: Rack::DevInsight::Config
- Inherits:
-
Object
- Object
- Rack::DevInsight::Config
- Defined in:
- lib/rack/dev_insight/config.rb
Instance Attribute Summary collapse
-
#backtrace_depth ⇒ Object
Returns the value of attribute backtrace_depth.
-
#backtrace_exclusion_patterns ⇒ Object
Returns the value of attribute backtrace_exclusion_patterns.
-
#detected_dialect ⇒ Object
Returns the value of attribute detected_dialect.
-
#file_store_dir_path ⇒ Object
Returns the value of attribute file_store_dir_path.
-
#file_store_pool_size ⇒ Object
Returns the value of attribute file_store_pool_size.
-
#memory_store_size ⇒ Object
Returns the value of attribute memory_store_size.
-
#prepared_statement_limit ⇒ Object
Returns the value of attribute prepared_statement_limit.
-
#skip_cached_sql ⇒ Object
Returns the value of attribute skip_cached_sql.
-
#skip_paths ⇒ Object
Returns the value of attribute skip_paths.
-
#storage_type ⇒ Object
Returns the value of attribute storage_type.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #storage_instance ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rack/dev_insight/config.rb', line 17 def initialize @storage_type = :memory @memory_store_size = 32 * 1024 * 1024 @file_store_pool_size = 100 @file_store_dir_path = 'tmp/rack-dev_insight' @skip_paths = [] @backtrace_depth = 5 @backtrace_exclusion_patterns = [%r{/gems/}] @prepared_statement_limit = 1000 @skip_cached_sql = true end |
Instance Attribute Details
#backtrace_depth ⇒ Object
Returns the value of attribute backtrace_depth.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def backtrace_depth @backtrace_depth end |
#backtrace_exclusion_patterns ⇒ Object
Returns the value of attribute backtrace_exclusion_patterns.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def backtrace_exclusion_patterns @backtrace_exclusion_patterns end |
#detected_dialect ⇒ Object
Returns the value of attribute detected_dialect.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def detected_dialect @detected_dialect end |
#file_store_dir_path ⇒ Object
Returns the value of attribute file_store_dir_path.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def file_store_dir_path @file_store_dir_path end |
#file_store_pool_size ⇒ Object
Returns the value of attribute file_store_pool_size.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def file_store_pool_size @file_store_pool_size end |
#memory_store_size ⇒ Object
Returns the value of attribute memory_store_size.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def memory_store_size @memory_store_size end |
#prepared_statement_limit ⇒ Object
Returns the value of attribute prepared_statement_limit.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def prepared_statement_limit @prepared_statement_limit end |
#skip_cached_sql ⇒ Object
Returns the value of attribute skip_cached_sql.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def skip_cached_sql @skip_cached_sql end |
#skip_paths ⇒ Object
Returns the value of attribute skip_paths.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def skip_paths @skip_paths end |
#storage_type ⇒ Object
Returns the value of attribute storage_type.
6 7 8 |
# File 'lib/rack/dev_insight/config.rb', line 6 def storage_type @storage_type end |
Instance Method Details
#storage_instance ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rack/dev_insight/config.rb', line 29 def storage_instance case storage_type.to_sym when :memory MemoryStore.new when :file FileStore.new else warn "warning: Unknown storage type: #{storage_type} in Rack::DevInsight::Config. " \ 'Available types are :memory and :file. Falling back to :memory.' MemoryStore.new end end |