Class: FhirPackagesManager::FetchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/fhir_packages_manager/fetch_result.rb,
sig/fhir_packages_manager/fetch_result.rbs

Overview

Outcome of Manager#fetch for a single package.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorString?

Returns the error message, when status is :error.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)

    the error message, when status is :error



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fhir_packages_manager/fetch_result.rb', line 16

class FetchResult < Struct.new(:package, :status, :registry, :path, :error, keyword_init: true)
  # @return [Boolean] true if the package was downloaded successfully
  def downloaded?
    status == :downloaded
  end

  # @return [Boolean] true if the package was skipped because it's on the ignore list
  def ignored?
    status == :ignored
  end

  # @return [Boolean] true if no registry had the package/version
  def not_found?
    status == :not_found
  end

  # @return [Boolean] true if downloading raised an HTTP error
  def error?
    status == :error
  end
end

#packagePackage

Returns the package that was requested (version resolved, when downloaded).

Parameters:

Returns:

  • (Package)

    the package that was requested (version resolved, when downloaded)



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fhir_packages_manager/fetch_result.rb', line 16

class FetchResult < Struct.new(:package, :status, :registry, :path, :error, keyword_init: true)
  # @return [Boolean] true if the package was downloaded successfully
  def downloaded?
    status == :downloaded
  end

  # @return [Boolean] true if the package was skipped because it's on the ignore list
  def ignored?
    status == :ignored
  end

  # @return [Boolean] true if no registry had the package/version
  def not_found?
    status == :not_found
  end

  # @return [Boolean] true if downloading raised an HTTP error
  def error?
    status == :error
  end
end

#pathString?

Returns where the tarball was written, if downloaded.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)

    where the tarball was written, if downloaded



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fhir_packages_manager/fetch_result.rb', line 16

class FetchResult < Struct.new(:package, :status, :registry, :path, :error, keyword_init: true)
  # @return [Boolean] true if the package was downloaded successfully
  def downloaded?
    status == :downloaded
  end

  # @return [Boolean] true if the package was skipped because it's on the ignore list
  def ignored?
    status == :ignored
  end

  # @return [Boolean] true if no registry had the package/version
  def not_found?
    status == :not_found
  end

  # @return [Boolean] true if downloading raised an HTTP error
  def error?
    status == :error
  end
end

#registryString?

Returns the base URL of the registry that served the package, if downloaded.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)

    the base URL of the registry that served the package, if downloaded



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fhir_packages_manager/fetch_result.rb', line 16

class FetchResult < Struct.new(:package, :status, :registry, :path, :error, keyword_init: true)
  # @return [Boolean] true if the package was downloaded successfully
  def downloaded?
    status == :downloaded
  end

  # @return [Boolean] true if the package was skipped because it's on the ignore list
  def ignored?
    status == :ignored
  end

  # @return [Boolean] true if no registry had the package/version
  def not_found?
    status == :not_found
  end

  # @return [Boolean] true if downloading raised an HTTP error
  def error?
    status == :error
  end
end

#statusSymbol

Returns one of :downloaded, :ignored, :not_found, :error.

Parameters:

  • value (Symbol)

Returns:

  • (Symbol)

    one of :downloaded, :ignored, :not_found, :error



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fhir_packages_manager/fetch_result.rb', line 16

class FetchResult < Struct.new(:package, :status, :registry, :path, :error, keyword_init: true)
  # @return [Boolean] true if the package was downloaded successfully
  def downloaded?
    status == :downloaded
  end

  # @return [Boolean] true if the package was skipped because it's on the ignore list
  def ignored?
    status == :ignored
  end

  # @return [Boolean] true if no registry had the package/version
  def not_found?
    status == :not_found
  end

  # @return [Boolean] true if downloading raised an HTTP error
  def error?
    status == :error
  end
end

Class Method Details

.newFetchResult

Parameters:

  • package: (Package)
  • status: (Symbol)
  • registry: (String, nil)
  • path: (String, nil)
  • error: (String, nil)

Returns:



9
# File 'sig/fhir_packages_manager/fetch_result.rbs', line 9

def self.new: (package: Package, status: Symbol, ?registry: String?, ?path: String?, ?error: String?) -> FetchResult

Instance Method Details

#downloaded?Boolean

Returns true if the package was downloaded successfully.

Returns:

  • (Boolean)

    true if the package was downloaded successfully



18
19
20
# File 'lib/fhir_packages_manager/fetch_result.rb', line 18

def downloaded?
  status == :downloaded
end

#error?Boolean

Returns true if downloading raised an HTTP error.

Returns:

  • (Boolean)

    true if downloading raised an HTTP error



33
34
35
# File 'lib/fhir_packages_manager/fetch_result.rb', line 33

def error?
  status == :error
end

#ignored?Boolean

Returns true if the package was skipped because it's on the ignore list.

Returns:

  • (Boolean)

    true if the package was skipped because it's on the ignore list



23
24
25
# File 'lib/fhir_packages_manager/fetch_result.rb', line 23

def ignored?
  status == :ignored
end

#not_found?Boolean

Returns true if no registry had the package/version.

Returns:

  • (Boolean)

    true if no registry had the package/version



28
29
30
# File 'lib/fhir_packages_manager/fetch_result.rb', line 28

def not_found?
  status == :not_found
end