Class: ServerBackups::RestoreBase

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

Direct Known Subclasses

MysqlRestore, WebsiteRestore

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file, working_dir, restore_point) ⇒ RestoreBase

Returns a new instance of RestoreBase.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/server_backups/restore_base.rb', line 7

def initialize(config_file, working_dir, restore_point)
    @working_dir = working_dir
    @config = Config.new(config_file)
    Time.zone = config.time_zone
    @restore_point = if restore_point.present?
                         restore_point
                     else
                         Time.zone.now
                     end
    @s3 = S3.new(config)
    logger.debug "Initialized #{title}."
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/server_backups/restore_base.rb', line 5

def config
  @config
end

#databaseObject (readonly)

Returns the value of attribute database.



5
6
7
# File 'lib/server_backups/restore_base.rb', line 5

def database
  @database
end

#restore_pointObject (readonly)

Returns the value of attribute restore_point.



5
6
7
# File 'lib/server_backups/restore_base.rb', line 5

def restore_point
  @restore_point
end

#s3Object (readonly)

Returns the value of attribute s3.



5
6
7
# File 'lib/server_backups/restore_base.rb', line 5

def s3
  @s3
end

#working_dirObject (readonly)

Returns the value of attribute working_dir.



5
6
7
# File 'lib/server_backups/restore_base.rb', line 5

def working_dir
  @working_dir
end