Class: Hem::Lib::S3::Local::File
- Inherits:
-
Object
- Object
- Hem::Lib::S3::Local::File
- Defined in:
- lib/hem/lib/s3/local/file.rb
Instance Method Summary collapse
- #buffer ⇒ Object
- #close ⇒ Object
- #copy_from(io, opts = {}, &block) ⇒ Object
-
#initialize(file) ⇒ File
constructor
A new instance of File.
- #read_io ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(file) ⇒ File
Returns a new instance of File.
6 7 8 |
# File 'lib/hem/lib/s3/local/file.rb', line 6 def initialize file @file = file end |
Instance Method Details
#buffer ⇒ Object
10 11 12 |
# File 'lib/hem/lib/s3/local/file.rb', line 10 def buffer # NOP end |
#close ⇒ Object
18 19 20 |
# File 'lib/hem/lib/s3/local/file.rb', line 18 def close @file.close end |
#copy_from(io, opts = {}, &block) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/hem/lib/s3/local/file.rb', line 26 def copy_from io, opts = {}, &block begin while (data = io.readpartial 16984) do @file.write data yield data if block_given? end rescue EOFError # NOP end end |
#read_io ⇒ Object
22 23 24 |
# File 'lib/hem/lib/s3/local/file.rb', line 22 def read_io @file end |
#size ⇒ Object
14 15 16 |
# File 'lib/hem/lib/s3/local/file.rb', line 14 def size @file.size end |