Class: PgCanary::Configuration
- Inherits:
-
Object
- Object
- PgCanary::Configuration
- Defined in:
- lib/pg_canary/configuration.rb
Instance Attribute Summary collapse
-
#app_root ⇒ Object
Returns the value of attribute app_root.
-
#enabled ⇒ Object
nil means "not explicitly configured" — the Railtie then enables pg_canary in development/test only.
-
#ignore_tables ⇒ Object
False-positive controls.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
- #ignore_table?(table) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 21 |
# File 'lib/pg_canary/configuration.rb', line 15 def initialize @enabled = nil @ignore_tables = %w[schema_migrations ar_internal_metadata] @rules = RulesConfig.new @logger = nil @app_root = nil end |
Instance Attribute Details
#app_root ⇒ Object
Returns the value of attribute app_root.
12 13 14 |
# File 'lib/pg_canary/configuration.rb', line 12 def app_root @app_root end |
#enabled ⇒ Object
nil means "not explicitly configured" — the Railtie then enables pg_canary in development/test only.
7 8 9 |
# File 'lib/pg_canary/configuration.rb', line 7 def enabled @enabled end |
#ignore_tables ⇒ Object
False-positive controls
10 11 12 |
# File 'lib/pg_canary/configuration.rb', line 10 def ignore_tables @ignore_tables end |
#logger ⇒ Object
Returns the value of attribute logger.
12 13 14 |
# File 'lib/pg_canary/configuration.rb', line 12 def logger @logger end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
13 14 15 |
# File 'lib/pg_canary/configuration.rb', line 13 def rules @rules end |
Instance Method Details
#ignore_table?(table) ⇒ Boolean
23 24 25 |
# File 'lib/pg_canary/configuration.rb', line 23 def ignore_table?(table) table && ignore_tables.map(&:to_s).include?(table.to_s) end |