Class: AnjeaBackup::BackupItem

Inherits:
Object
  • Object
show all
Defined in:
lib/anjea_backup/anjea_backup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/anjea_backup/anjea_backup.rb', line 9

def description
  @description
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/anjea_backup/anjea_backup.rb', line 8

def name
  @name
end

#src_dirObject

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_keyObject

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_urlObject

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