Module: Cloudpt::API::Fileops
Instance Method Summary collapse
- #copy(to, options = {}) ⇒ Object
- #destroy(options = {}) ⇒ Object
- #move(to, options = {}) ⇒ Object
- #path ⇒ Object
Instance Method Details
#copy(to, options = {}) ⇒ Object
6 7 8 9 |
# File 'lib/cloudpt-api/objects/fileops.rb', line 6 def copy(to, = {}) response = client.raw.copy({ :from_path => "/#{self.path}", :to_path => "/#{Cloudpt::API::Util.strip_slash(to)}" }.merge()) self.update response end |
#destroy(options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/cloudpt-api/objects/fileops.rb', line 16 def destroy( = {}) response = client.raw.delete({ :path => "/#{self.path}" }.merge()) self.update response end |
#move(to, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/cloudpt-api/objects/fileops.rb', line 11 def move(to, = {}) response = client.raw.move({ :from_path => "/#{self.path}", :to_path => "/#{Cloudpt::API::Util.strip_slash(to)}" }.merge()) self.update response end |
#path ⇒ Object
21 22 23 |
# File 'lib/cloudpt-api/objects/fileops.rb', line 21 def path Cloudpt::API::Util.strip_slash(self['path']) end |