Class: FhirPackagesManager::FetchResult
- Inherits:
-
Struct
- Object
- Struct
- FhirPackagesManager::FetchResult
- Defined in:
- lib/fhir_packages_manager/fetch_result.rb
Overview
Outcome of Manager#fetch (or Manager#sync) for a single package/version.
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 (or already is) on disk, if downloaded/skipped.
-
#registry ⇒ String?
The base URL of the registry that served the package, if downloaded.
-
#status ⇒ Symbol
One of :downloaded, :ignored, :skipped, :not_found, :error.
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.
-
#skipped? ⇒ Boolean
True if Manager#sync skipped it because it was already downloaded.
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 37 38 39 40 41 |
# 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 {Manager#sync} skipped it because it was already downloaded def skipped? status == :skipped 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 37 38 39 40 41 |
# 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 {Manager#sync} skipped it because it was already downloaded def skipped? status == :skipped 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 (or already is) on disk, if downloaded/skipped.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# 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 {Manager#sync} skipped it because it was already downloaded def skipped? status == :skipped 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 37 38 39 40 41 |
# 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 {Manager#sync} skipped it because it was already downloaded def skipped? status == :skipped 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, :skipped, :not_found, :error.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# 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 {Manager#sync} skipped it because it was already downloaded def skipped? status == :skipped 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 |
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.
38 39 40 |
# File 'lib/fhir_packages_manager/fetch_result.rb', line 38 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.
33 34 35 |
# File 'lib/fhir_packages_manager/fetch_result.rb', line 33 def not_found? status == :not_found end |
#skipped? ⇒ Boolean
Returns true if Manager#sync skipped it because it was already downloaded.
28 29 30 |
# File 'lib/fhir_packages_manager/fetch_result.rb', line 28 def skipped? status == :skipped end |