Class: Astrails::Safe::Backup

Inherits:
Object
  • Object
show all
Defined in:
lib/astrails/safe/backup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Backup

Returns a new instance of Backup.



5
6
7
8
9
# File 'lib/astrails/safe/backup.rb', line 5

def initialize(opts = {})
  opts.each do |k, v|
    self.send("#{k}=", v)
  end
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def command
  @command
end

#compressedObject

Returns the value of attribute compressed.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def compressed
  @compressed
end

#extensionObject

Returns the value of attribute extension.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def extension
  @extension
end

#filenameObject

Returns the value of attribute filename.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def filename
  @filename
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def id
  @id
end

#kindObject

Returns the value of attribute kind.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def kind
  @kind
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def path
  @path
end

#timestampObject

Returns the value of attribute timestamp.



4
5
6
# File 'lib/astrails/safe/backup.rb', line 4

def timestamp
  @timestamp
end

Instance Method Details

#run(config, *mods) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/astrails/safe/backup.rb', line 11

def run(config, *mods)
  mods.each do |mod|
    mod = mod.to_s
    mod[0] = mod[0..0].upcase
    Astrails::Safe.const_get(mod).new(config, self).process
  end
end