Class: Remote::Session::Send
- Inherits:
-
Object
- Object
- Remote::Session::Send
- Defined in:
- lib/remote/session/send.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
Instance Method Summary collapse
- #close ⇒ Object
- #eof? ⇒ Boolean
-
#initialize(remote_path) ⇒ Send
constructor
A new instance of Send.
- #open ⇒ Object
- #open? ⇒ Boolean
- #read ⇒ Object
Constructor Details
#initialize(remote_path) ⇒ Send
Returns a new instance of Send.
10 11 12 13 14 |
# File 'lib/remote/session/send.rb', line 10 def initialize( remote_path ) @remote_path = remote_path @chunk_size = 1024 @file = nil end |
Instance Attribute Details
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
8 9 10 |
# File 'lib/remote/session/send.rb', line 8 def chunk_size @chunk_size end |
#remote_path ⇒ Object
Returns the value of attribute remote_path.
7 8 9 |
# File 'lib/remote/session/send.rb', line 7 def remote_path @remote_path end |
Instance Method Details
#close ⇒ Object
40 41 42 43 44 |
# File 'lib/remote/session/send.rb', line 40 def close return if ! open? @file.close @file = nil end |
#eof? ⇒ Boolean
22 23 24 25 |
# File 'lib/remote/session/send.rb', line 22 def eof? return true if ! open? @file.eof? end |
#open ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/remote/session/send.rb', line 31 def open if open? @file.rewind return end _open end |
#open? ⇒ Boolean
27 28 29 |
# File 'lib/remote/session/send.rb', line 27 def open? ! @file.nil? end |
#read ⇒ Object
16 17 18 19 20 |
# File 'lib/remote/session/send.rb', line 16 def read open if ! open? @file.read( @chunk_size ) end |