Class: Hx::Interop::Interceptor::Base
- Inherits:
-
Object
- Object
- Hx::Interop::Interceptor::Base
- Defined in:
- lib/interop/interceptor/base.rb
Overview
Base class for read and write interceptors
Instance Method Summary collapse
-
#initialize(stream, &block) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(stream, &block) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/interop/interceptor/base.rb', line 6 def initialize(stream, &block) raise ArgumentError, 'Expected a block that takes exactly 2 arguments' unless [2, -1].include? block&.arity @stream = stream @handler = block end |