Class: IRODS4r::File
- Inherits:
-
Object
- Object
- IRODS4r::File
- Defined in:
- lib/irods4r/file.rb
Overview
This class proxies a file in an iRODS environment
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
-
.create(path, must_not_exist = true, opts = {}) ⇒ Object
Create a file resource ‘path’.
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #file? ⇒ Boolean
-
#read ⇒ Object
Return the content of this file.
-
#write(content) ⇒ Object
Write content to this file.
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
46 47 48 |
# File 'lib/irods4r/file.rb', line 46 def path @path end |
Class Method Details
.create(path, must_not_exist = true, opts = {}) ⇒ Object
Create a file resource ‘path’. If ‘must_not_exist’ is true, throw exception if resource already exists.
17 18 19 20 21 22 |
# File 'lib/irods4r/file.rb', line 17 def self.create(path, must_not_exist = true, opts = {}) if must_not_exist raise FileExistsException.new(path) if ICommands.exist?(path) end self.new(path, opts) end |
Instance Method Details
#directory? ⇒ Boolean
42 43 44 |
# File 'lib/irods4r/file.rb', line 42 def directory? return false end |
#file? ⇒ Boolean
38 39 40 |
# File 'lib/irods4r/file.rb', line 38 def file? return true end |