Class: Bard::Backup::Controller

Inherits:
Struct
  • Object
show all
Defined in:
lib/bard/backup/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_keyObject

Returns the value of attribute access_key

Returns:

  • (Object)

    the current value of access_key



6
7
8
# File 'lib/bard/backup/controller.rb', line 6

def access_key
  @access_key
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



6
7
8
# File 'lib/bard/backup/controller.rb', line 6

def filename
  @filename
end

#s3_pathObject

Returns the value of attribute s3_path

Returns:

  • (Object)

    the current value of s3_path



6
7
8
# File 'lib/bard/backup/controller.rb', line 6

def s3_path
  @s3_path
end

#secret_keyObject

Returns the value of attribute secret_key

Returns:

  • (Object)

    the current value of secret_key



6
7
8
# File 'lib/bard/backup/controller.rb', line 6

def secret_key
  @secret_key
end

Instance Method Details

#callObject



7
8
9
10
11
12
# File 'lib/bard/backup/controller.rb', line 7

def call
  path = "/tmp/#{filename}"
  Backhoe.dump path
  s3_dir = S3Dir.new(path: s3_path, access_key:, secret_key:)
  s3_dir.put path
end