Class: NoopBackup::Stores::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/noop_backup/stores/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bytesObject

Returns the value of attribute bytes

Returns:

  • (Object)

    the current value of bytes



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def bytes
  @bytes
end

#durationObject

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def duration
  @duration
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def error
  @error
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def key
  @key
end

#storeObject

Returns the value of attribute store

Returns:

  • (Object)

    the current value of store



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def store
  @store
end

#successObject

Returns the value of attribute success

Returns:

  • (Object)

    the current value of success



2
3
4
# File 'lib/noop_backup/stores/result.rb', line 2

def success
  @success
end

Instance Method Details

#messageObject



3
4
5
6
7
8
9
# File 'lib/noop_backup/stores/result.rb', line 3

def message
  if success
    "✅ [#{store}] Backup successful — #{NoopBackup.utils.human_size(bytes)} in #{duration.round(1)}s → /#{key}"
  else
    "❌ [#{store}] Backup failed: #{error.message}"
  end
end