Class: NPlusInsight::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/n_plus_insight/configuration.rb', line 3

def enabled
  @enabled
end

#ignore_pathsObject

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_sqlObject

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_eventsObject

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_repetitionsObject

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_pathObject

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_pageObject

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_detectionObject

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