Class: CloudFile::Copy
- Includes:
- FromHash
- Defined in:
- lib/cloud_file/copy.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
4 5 6 |
# File 'lib/cloud_file/copy.rb', line 4 def format @format end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/cloud_file/copy.rb', line 4 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
4 5 6 |
# File 'lib/cloud_file/copy.rb', line 4 def target @target end |
Instance Method Details
#run! ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/cloud_file/copy.rb', line 6 def run! CloudFile.open(source) do |s| CloudFile.open(target) do |t| #t << s.read_format(format || t.service.class.format) t << s.read end end end |