Module: Postmark::Deprecations
- Defined in:
- lib/postmark/deprecations.rb
Constant Summary collapse
- DEFAULT_BEHAVIORS =
{ :raise => lambda { || raise }, :log => lambda { || warn }, :silence => lambda { || }, }
Class Method Summary collapse
- .add_constants(mappings) ⇒ Object
- .behavior ⇒ Object
- .behavior=(behavior) ⇒ Object
- .deprecated_constants ⇒ Object
- .report(message) ⇒ Object
Class Method Details
.add_constants(mappings) ⇒ Object
31 32 33 |
# File 'lib/postmark/deprecations.rb', line 31 def self.add_constants(mappings) deprecated_constants.merge!(mappings) end |
.behavior ⇒ Object
23 24 25 |
# File 'lib/postmark/deprecations.rb', line 23 def self.behavior @behavior ||= :log end |
.behavior=(behavior) ⇒ Object
27 28 29 |
# File 'lib/postmark/deprecations.rb', line 27 def self.behavior=(behavior) @behavior = behavior end |
.deprecated_constants ⇒ Object
19 20 21 |
# File 'lib/postmark/deprecations.rb', line 19 def self.deprecated_constants @deprecated_constants ||= {} end |
.report(message) ⇒ Object
15 16 17 |
# File 'lib/postmark/deprecations.rb', line 15 def self.report() DEFAULT_BEHAVIORS.fetch(behavior).call() end |