Class: Net::ReadAdapter
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/net/protocol.rb |
Overview
internal use only
Class Method Summary
- .new(block) ⇒ ReadAdapter constructor
Instance Method Summary
- #<<(str)
- #inspect
-
#call_block(str) {|str| ... }
private
This method is needed because @block must be called by yield, not
Proc#call
.
Constructor Details
.new(block) ⇒ ReadAdapter
# File 'lib/net/protocol.rb', line 415
def initialize(block) @block = block end
Instance Method Details
#<<(str)
[ GitHub ]# File 'lib/net/protocol.rb', line 423
def <<(str) call_block(str, &@block) if @block end
#call_block(str) {|str| ... } (private)
This method is needed because @block must be called by yield, not Proc#call
. You can see difference when using `break' in the block.
# File 'lib/net/protocol.rb', line 432
def call_block(str) yield str end
#inspect
[ GitHub ]# File 'lib/net/protocol.rb', line 419
def inspect "#<#{self.class}>" end