Class: NPlusInsight::Configuration
- Inherits:
-
Object
- Object
- NPlusInsight::Configuration
- Defined in:
- lib/n_plus_insight/configuration.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#ignore_paths ⇒ Object
Returns the value of attribute ignore_paths.
-
#ignore_sql ⇒ Object
Returns the value of attribute ignore_sql.
-
#max_events ⇒ Object
Returns the value of attribute max_events.
-
#minimum_repetitions ⇒ Object
Returns the value of attribute minimum_repetitions.
-
#mount_path ⇒ Object
Returns the value of attribute mount_path.
-
#on_page ⇒ Object
Returns the value of attribute on_page.
-
#raise_on_detection ⇒ Object
Returns the value of attribute raise_on_detection.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/n_plus_insight/configuration.rb', line 6 def initialize @enabled = ENV.fetch("NPLUS_INSIGHT_ENABLED", "false").match?(/\A(?:1|true|yes|on)\z/i) @minimum_repetitions = 2 @max_events = 100 @mount_path = "/n_plus_insight" @ignore_paths = [%r{\A/assets}, %r{\A/packs}, %r{\A/rails/active_storage}] @ignore_sql = [/\A(?:BEGIN|COMMIT|ROLLBACK|SAVEPOINT|RELEASE)/i, /schema_migrations/i, /ar_internal_metadata/i] @raise_on_detection = false @on_page = true end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def enabled @enabled end |
#ignore_paths ⇒ Object
Returns the value of attribute ignore_paths.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def ignore_paths @ignore_paths end |
#ignore_sql ⇒ Object
Returns the value of attribute ignore_sql.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def ignore_sql @ignore_sql end |
#max_events ⇒ Object
Returns the value of attribute max_events.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def max_events @max_events end |
#minimum_repetitions ⇒ Object
Returns the value of attribute minimum_repetitions.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def minimum_repetitions @minimum_repetitions end |
#mount_path ⇒ Object
Returns the value of attribute mount_path.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def mount_path @mount_path end |
#on_page ⇒ Object
Returns the value of attribute on_page.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def on_page @on_page end |
#raise_on_detection ⇒ Object
Returns the value of attribute raise_on_detection.
3 4 5 |
# File 'lib/n_plus_insight/configuration.rb', line 3 def raise_on_detection @raise_on_detection end |