Class: AnjeaBackup::BackupItem
- Inherits:
-
Object
- Object
- AnjeaBackup::BackupItem
- Defined in:
- lib/anjea_backup/backup_item.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.
9 10 11 12 13 14 15 16 17 |
# File 'lib/anjea_backup/backup_item.rb', line 9 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.
4 5 6 |
# File 'lib/anjea_backup/backup_item.rb', line 4 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/anjea_backup/backup_item.rb', line 3 def name @name end |
#src_dir ⇒ Object
Returns the value of attribute src_dir.
5 6 7 |
# File 'lib/anjea_backup/backup_item.rb', line 5 def src_dir @src_dir end |
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
7 8 9 |
# File 'lib/anjea_backup/backup_item.rb', line 7 def ssh_key @ssh_key end |
#ssh_url ⇒ Object
Returns the value of attribute ssh_url.
6 7 8 |
# File 'lib/anjea_backup/backup_item.rb', line 6 def ssh_url @ssh_url end |