Class: FhirPackagesManager::FetchResult
- Inherits:
-
Struct
- Object
- Struct
- FhirPackagesManager::FetchResult
- 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
-
#error ⇒ String?
The error message, when status is :error.
-
#package ⇒ Package
The package that was requested (version resolved, when downloaded).
-
#path ⇒ String?
Where the tarball was written, if downloaded.
-
#registry ⇒ String?
The base URL of the registry that served the package, if downloaded.
-
#status ⇒ Symbol
One of :downloaded, :ignored, :not_found, :error.
Class Method Summary collapse
Instance Method Summary collapse
-
#downloaded? ⇒ Boolean
True if the package was downloaded successfully.
-
#error? ⇒ Boolean
True if downloading raised an HTTP error.
-
#ignored? ⇒ Boolean
True if the package was skipped because it's on the ignore list.
-
#not_found? ⇒ Boolean
True if no registry had the package/version.
Instance Attribute Details
#error ⇒ String?
Returns 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 |
#package ⇒ Package
Returns 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 |
#path ⇒ String?
Returns 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 |
#registry ⇒ String?
Returns 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 |
#status ⇒ Symbol
Returns 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
.new ⇒ FetchResult
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.
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.
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.
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.
28 29 30 |
# File 'lib/fhir_packages_manager/fetch_result.rb', line 28 def not_found? status == :not_found end |