Class: MyStuff::Fb303::ResilientProcessor::SpyIProt
- Inherits:
-
Object
- Object
- MyStuff::Fb303::ResilientProcessor::SpyIProt
- Defined in:
- lib/my_stuff/fb303/resilient_processor.rb
Instance Method Summary collapse
-
#initialize(iprot) ⇒ SpyIProt
constructor
A new instance of SpyIProt.
- #method_missing(*args) ⇒ Object
- #read_message_begin ⇒ Object
Constructor Details
#initialize(iprot) ⇒ SpyIProt
Returns a new instance of SpyIProt.
10 11 12 13 |
# File 'lib/my_stuff/fb303/resilient_processor.rb', line 10 def initialize iprot @iprot = iprot @mode = :capture end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
31 32 33 |
# File 'lib/my_stuff/fb303/resilient_processor.rb', line 31 def method_missing *args @iprot.send *args end |
Instance Method Details
#read_message_begin ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/my_stuff/fb303/resilient_processor.rb', line 15 def case @mode when :capture @header = @iprot. @mode = :replay @header when :replay @mode = :normal @header when :normal @iprot. else raise "Reached a bad state: %s" % @mode end end |