Class: Upkeep::Rails::Configuration
- Inherits:
-
Object
- Object
- Upkeep::Rails::Configuration
- Defined in:
- lib/upkeep/rails/configuration.rb
Constant Summary collapse
- SUBSCRIPTION_STORES =
[:active_record, :memory].freeze
- REFUSED_BOUNDARY_BEHAVIORS =
[:raise, :warn].freeze
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#subscription_store ⇒ Object
Returns the value of attribute subscription_store.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #refused_boundary_behavior ⇒ Object
- #refused_boundary_behavior=(value) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 |
# File 'lib/upkeep/rails/configuration.rb', line 14 def initialize @enabled = true @subscription_store = :active_record @refused_boundary_behavior = nil end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
11 12 13 |
# File 'lib/upkeep/rails/configuration.rb', line 11 def enabled @enabled end |
#subscription_store ⇒ Object
Returns the value of attribute subscription_store.
12 13 14 |
# File 'lib/upkeep/rails/configuration.rb', line 12 def subscription_store @subscription_store end |
Instance Method Details
#refused_boundary_behavior ⇒ Object
31 32 33 |
# File 'lib/upkeep/rails/configuration.rb', line 31 def refused_boundary_behavior @refused_boundary_behavior || default_refused_boundary_behavior end |
#refused_boundary_behavior=(value) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/upkeep/rails/configuration.rb', line 35 def refused_boundary_behavior=(value) value = value.to_sym if value.respond_to?(:to_sym) unless REFUSED_BOUNDARY_BEHAVIORS.include?(value) raise ConfigurationError, "Unknown Upkeep refused_boundary_behavior #{value.inspect}; expected one of #{REFUSED_BOUNDARY_BEHAVIORS.join(", ")}" end @refused_boundary_behavior = value end |