Method: Aptly::Errors::RepositoryFileError.from_hash

Defined in:
lib/aptly/errors.rb

.from_hash(hash, *args) ⇒ RepositoryFileError?

Construct a new instance from a hash

Parameters:

  • hash

    a file operation repsonse hash

Returns:

  • (RepositoryFileError)

    new error

  • (nil)

    if error is not applicable (hash has empty FailedFiles array)



72
73
74
75
# File 'lib/aptly/errors.rb', line 72

def from_hash(hash, *args)
  return nil if hash['FailedFiles'].empty?
  new(hash['FailedFiles'], hash['Report']['Warnings'], *args)
end