Class: BackupRestorer::FilePath
- Inherits:
-
Object
- Object
- BackupRestorer::FilePath
- Defined in:
- lib/backup-restorer.rb
Instance Attribute Summary collapse
-
#existance_on_source ⇒ Object
Returns the value of attribute existance_on_source.
-
#full_path ⇒ Object
Returns the value of attribute full_path.
-
#parent_path ⇒ Object
Returns the value of attribute parent_path.
Instance Method Summary collapse
- #exists_on_destination? ⇒ Boolean
- #exists_on_source?(type) ⇒ Boolean
-
#initialize(filepath) ⇒ FilePath
constructor
A new instance of FilePath.
Constructor Details
#initialize(filepath) ⇒ FilePath
Returns a new instance of FilePath.
59 60 61 62 |
# File 'lib/backup-restorer.rb', line 59 def initialize(filepath) @full_path = filepath @parent_path = get_parent_path end |
Instance Attribute Details
#existance_on_source ⇒ Object
Returns the value of attribute existance_on_source.
58 59 60 |
# File 'lib/backup-restorer.rb', line 58 def existance_on_source @existance_on_source end |
#full_path ⇒ Object
Returns the value of attribute full_path.
58 59 60 |
# File 'lib/backup-restorer.rb', line 58 def full_path @full_path end |
#parent_path ⇒ Object
Returns the value of attribute parent_path.
58 59 60 |
# File 'lib/backup-restorer.rb', line 58 def parent_path @parent_path end |
Instance Method Details
#exists_on_destination? ⇒ Boolean
63 64 65 |
# File 'lib/backup-restorer.rb', line 63 def exists_on_destination? File.exist?("#{CONF["paths"]["destination"]}/#{@full_path}") end |
#exists_on_source?(type) ⇒ Boolean
67 68 69 70 |
# File 'lib/backup-restorer.rb', line 67 def exists_on_source?(type) return @existance_on_source if type == "remote" File.exist?("#{CONF["paths"]["source"][@type]}/#{file_path.full_path}") end |