Class: Telm::Configuration
- Inherits:
-
Object
- Object
- Telm::Configuration
- Defined in:
- lib/telm/configuration.rb
Overview
Holds every user-tunable option. Configured via:
Telm.configure do |c|
c.excluded_models += ["LegacyAudit"]
c.redacted_columns += ["users.recovery_phrase"]
c.unredacted_columns += ["webhooks.token_hint"]
c.authenticate_with { |controller| controller.redirect_to "/" unless ... }
end
Instance Attribute Summary collapse
-
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
-
#redacted_columns ⇒ Object
Returns the value of attribute redacted_columns.
-
#unredacted_columns ⇒ Object
Returns the value of attribute unredacted_columns.
Instance Method Summary collapse
-
#authenticate_with(&block) ⇒ Object
Reader and block-setter in one: pass a block to set, call bare to read.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 |
# File 'lib/telm/configuration.rb', line 15 def initialize @excluded_models = [] @redacted_columns = [] @unredacted_columns = [] @authenticate_with = nil end |
Instance Attribute Details
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
13 14 15 |
# File 'lib/telm/configuration.rb', line 13 def excluded_models @excluded_models end |
#redacted_columns ⇒ Object
Returns the value of attribute redacted_columns.
13 14 15 |
# File 'lib/telm/configuration.rb', line 13 def redacted_columns @redacted_columns end |
#unredacted_columns ⇒ Object
Returns the value of attribute unredacted_columns.
13 14 15 |
# File 'lib/telm/configuration.rb', line 13 def unredacted_columns @unredacted_columns end |
Instance Method Details
#authenticate_with(&block) ⇒ Object
Reader and block-setter in one: pass a block to set, call bare to read.
23 24 25 26 |
# File 'lib/telm/configuration.rb', line 23 def authenticate_with(&block) @authenticate_with = block if block @authenticate_with end |