Class: Mapi::Pst::RangesIOEncryptable
- Inherits:
-
RangesIO
- Object
- RangesIO
- Mapi::Pst::RangesIOEncryptable
- Defined in:
- lib/mapi/pst.rb
Direct Known Subclasses
Instance Method Summary collapse
- #encrypted? ⇒ Boolean
-
#initialize(io, mode = 'r', params = {}) ⇒ RangesIOEncryptable
constructor
A new instance of RangesIOEncryptable.
- #read(limit = nil) ⇒ Object
Constructor Details
#initialize(io, mode = 'r', params = {}) ⇒ RangesIOEncryptable
Returns a new instance of RangesIOEncryptable.
243 244 245 246 247 |
# File 'lib/mapi/pst.rb', line 243 def initialize io, mode='r', params={} mode, params = 'r', mode if Hash === mode @decrypt = !!params[:decrypt] super end |
Instance Method Details
#encrypted? ⇒ Boolean
249 250 251 |
# File 'lib/mapi/pst.rb', line 249 def encrypted? @decrypt end |
#read(limit = nil) ⇒ Object
253 254 255 256 257 |
# File 'lib/mapi/pst.rb', line 253 def read limit=nil buf = super buf = CompressibleEncryption.decrypt(buf) if encrypted? buf end |