Class: AnjeaBackup::BackupItem
- Inherits:
-
Object
- Object
- AnjeaBackup::BackupItem
- Defined in:
- lib/anjea_backup/anjea_backup.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#src_dir ⇒ Object
Returns the value of attribute src_dir.
-
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
-
#ssh_url ⇒ Object
Returns the value of attribute ssh_url.
Instance Method Summary collapse
-
#initialize(hash) ⇒ BackupItem
constructor
A new instance of BackupItem.
Constructor Details
#initialize(hash) ⇒ BackupItem
Returns a new instance of BackupItem.
14 15 16 17 18 19 20 21 22 |
# File 'lib/anjea_backup/anjea_backup.rb', line 14 def initialize hash @name = hash[:name] @description = hash['description'] @src_dir = hash['src'] if hash['host'] && hash['user'] && hash['key'] @ssh_url = "#{hash['user']}@#{hash['host']}:#{@src_dir}" @ssh_key = hash['key'] end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/anjea_backup/anjea_backup.rb', line 9 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/anjea_backup/anjea_backup.rb', line 8 def name @name end |
#src_dir ⇒ Object
Returns the value of attribute src_dir.
10 11 12 |
# File 'lib/anjea_backup/anjea_backup.rb', line 10 def src_dir @src_dir end |
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
12 13 14 |
# File 'lib/anjea_backup/anjea_backup.rb', line 12 def ssh_key @ssh_key end |
#ssh_url ⇒ Object
Returns the value of attribute ssh_url.
11 12 13 |
# File 'lib/anjea_backup/anjea_backup.rb', line 11 def ssh_url @ssh_url end |