Class: CloudFile::Copy

Inherits:
Object show all
Includes:
FromHash
Defined in:
lib/cloud_file/copy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#formatObject

Returns the value of attribute format.



4
5
6
# File 'lib/cloud_file/copy.rb', line 4

def format
  @format
end

#sourceObject

Returns the value of attribute source.



4
5
6
# File 'lib/cloud_file/copy.rb', line 4

def source
  @source
end

#targetObject

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