Class: Virgil::Crypto::VirgilStreamDataSink
- Inherits:
-
Core::VirgilDataSink
- Object
- Core::VirgilDataSink
- Virgil::Crypto::VirgilStreamDataSink
- Defined in:
- lib/virgil/crypto/stream_data_sink.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(stream) ⇒ VirgilStreamDataSink
constructor
A new instance of VirgilStreamDataSink.
- #is_good ⇒ Object
- #write(data) ⇒ Object
Constructor Details
#initialize(stream) ⇒ VirgilStreamDataSink
Returns a new instance of VirgilStreamDataSink.
40 41 42 43 |
# File 'lib/virgil/crypto/stream_data_sink.rb', line 40 def initialize(stream) @stream = stream super() end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
38 39 40 |
# File 'lib/virgil/crypto/stream_data_sink.rb', line 38 def stream @stream end |
Instance Method Details
#is_good ⇒ Object
45 46 47 |
# File 'lib/virgil/crypto/stream_data_sink.rb', line 45 def is_good !stream.closed? end |
#write(data) ⇒ Object
49 50 51 |
# File 'lib/virgil/crypto/stream_data_sink.rb', line 49 def write(data) stream.write(data.pack('c*')) end |