Class: MessageCollectorProcessed
- Inherits:
-
MessageCollector
- Object
- MessageCollector
- MessageCollectorProcessed
- Defined in:
- bin/minecraftctlserver
Direct Known Subclasses
Instance Method Summary collapse
- #collect(msg) ⇒ Object
-
#initialize(&operations) ⇒ MessageCollectorProcessed
constructor
A new instance of MessageCollectorProcessed.
- #process(&block) ⇒ Object
Methods inherited from MessageCollector
Constructor Details
#initialize(&operations) ⇒ MessageCollectorProcessed
Returns a new instance of MessageCollectorProcessed.
16 17 18 19 |
# File 'bin/minecraftctlserver', line 16 def initialize(&operations) super(&operations) @processors = [] end |
Instance Method Details
#collect(msg) ⇒ Object
26 27 28 29 30 31 |
# File 'bin/minecraftctlserver', line 26 def collect(msg) @processors.each do |processor| msg = processor.call(msg) end @collector.call(msg) if msg end |
#process(&block) ⇒ Object
21 22 23 24 |
# File 'bin/minecraftctlserver', line 21 def process(&block) @processors << block self end |