Class: Message::Filters
- Inherits:
-
Object
- Object
- Message::Filters
- Includes:
- Enumerable
- Defined in:
- lib/message/filters.rb,
lib/message/filters/benchmarking.rb,
lib/message/filters/error_handling.rb,
lib/message/filters/retry_on_error.rb
Defined Under Namespace
Classes: Benchmarking, ErrorHandling, RetryOnError
Instance Attribute Summary collapse
-
#benchmarking ⇒ Object
Returns the value of attribute benchmarking.
-
#error_handling ⇒ Object
Returns the value of attribute error_handling.
-
#retry_on_error ⇒ Object
Returns the value of attribute retry_on_error.
Instance Method Summary collapse
- #<<(filter) ⇒ Object
- #defaults ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Filters
constructor
A new instance of Filters.
- #load(data) ⇒ Object
Constructor Details
#initialize ⇒ Filters
Returns a new instance of Filters.
11 12 13 14 15 16 17 |
# File 'lib/message/filters.rb', line 11 def initialize @data = [] @error_handling = ErrorHandling.new @benchmarking = Benchmarking.new @retry_on_error = RetryOnError.new load(defaults) end |
Instance Attribute Details
#benchmarking ⇒ Object
Returns the value of attribute benchmarking.
9 10 11 |
# File 'lib/message/filters.rb', line 9 def benchmarking @benchmarking end |
#error_handling ⇒ Object
Returns the value of attribute error_handling.
9 10 11 |
# File 'lib/message/filters.rb', line 9 def error_handling @error_handling end |
#retry_on_error ⇒ Object
Returns the value of attribute retry_on_error.
9 10 11 |
# File 'lib/message/filters.rb', line 9 def retry_on_error @retry_on_error end |
Instance Method Details
#<<(filter) ⇒ Object
19 20 21 |
# File 'lib/message/filters.rb', line 19 def <<(filter) @data << filter end |
#defaults ⇒ Object
29 30 31 |
# File 'lib/message/filters.rb', line 29 def defaults [:error_handling, :benchmarking, :retry_on_error] end |
#each(&block) ⇒ Object
33 34 35 |
# File 'lib/message/filters.rb', line 33 def each(&block) @data.each(&block) end |
#load(data) ⇒ Object
23 24 25 26 27 |
# File 'lib/message/filters.rb', line 23 def load(data) data.each do |m| @data << [m, send(m)] end end |