Class: RosettaQueue::Filters
- Inherits:
-
Object
- Object
- RosettaQueue::Filters
- Defined in:
- lib/rosetta_queue/filters.rb
Class Method Summary collapse
- .define {|_self| ... } ⇒ Object
- .process_receiving(message) ⇒ Object
- .process_sending(message) ⇒ Object
- .receiving(&receiving_filter) ⇒ Object
- .reset ⇒ Object
- .safe_process_receiving(message) ⇒ Object
- .safe_process_sending(message) ⇒ Object
- .sending(&sending_filter) ⇒ Object
Class Method Details
.define {|_self| ... } ⇒ Object
13 14 15 |
# File 'lib/rosetta_queue/filters.rb', line 13 def define yield self end |
.process_receiving(message) ⇒ Object
35 36 37 38 |
# File 'lib/rosetta_queue/filters.rb', line 35 def process_receiving() return unless @receiving @receiving.call() end |
.process_sending(message) ⇒ Object
30 31 32 33 |
# File 'lib/rosetta_queue/filters.rb', line 30 def process_sending() return unless @sending @sending.call() end |
.receiving(&receiving_filter) ⇒ Object
22 23 24 |
# File 'lib/rosetta_queue/filters.rb', line 22 def receiving(&receiving_filter) @receiving = receiving_filter end |
.reset ⇒ Object
17 18 19 20 |
# File 'lib/rosetta_queue/filters.rb', line 17 def reset @receiving = nil @sending = nil end |
.safe_process_receiving(message) ⇒ Object
44 45 46 |
# File 'lib/rosetta_queue/filters.rb', line 44 def safe_process_receiving() safe(:process_receiving, ) end |
.safe_process_sending(message) ⇒ Object
40 41 42 |
# File 'lib/rosetta_queue/filters.rb', line 40 def safe_process_sending() safe(:process_sending, ) end |
.sending(&sending_filter) ⇒ Object
26 27 28 |
# File 'lib/rosetta_queue/filters.rb', line 26 def sending(&sending_filter) @sending = sending_filter end |