Class: PDK::Template::Fetcher::AbstractFetcher Abstract Private
- Inherits:
-
Object
- Object
- PDK::Template::Fetcher::AbstractFetcher
- Defined in:
- lib/pdk/template/fetcher.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
An abstract class which all Template Fetchers should subclass. This class is responsible for downloading or copying a Template Directory that is pointed to by a Template URI
Instance Attribute Summary collapse
-
#fetched ⇒ Boolean
readonly
private
Whether the template has been fetched yet.
-
#metadata ⇒ Hash
readonly
private
The metadata hash for this template.
-
#path ⇒ String
readonly
private
The local filesystem path of the fetched template.
-
#temporary ⇒ Boolean
readonly
private
Whether the fetched path should be considered temporary and be deleted after use.
-
#uri ⇒ PDK::Util::TemplateURI
readonly
private
The URI of the template that is to be fetched.
Instance Method Summary collapse
-
#fetch! ⇒ void
abstract
private
Fetches the template directory and populates the path property.
-
#initialize(uri, options) ⇒ AbstractFetcher
constructor
private
A new instance of AbstractFetcher.
Constructor Details
#initialize(uri, options) ⇒ AbstractFetcher
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AbstractFetcher.
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/pdk/template/fetcher.rb', line 76 def initialize(uri, ) @uri = uri # Defaults @path = nil @metadata = { 'pdk-version' => PDK::Util::Version.version_string, 'template-url' => nil, 'template-ref' => nil } @fetched = false @temporary = false @options = end |
Instance Attribute Details
#fetched ⇒ Boolean (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Whether the template has been fetched yet.
69 70 71 |
# File 'lib/pdk/template/fetcher.rb', line 69 def fetched @fetched end |
#metadata ⇒ Hash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The metadata hash for this template.
72 73 74 |
# File 'lib/pdk/template/fetcher.rb', line 72 def @metadata end |
#path ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The local filesystem path of the fetched template.
63 64 65 |
# File 'lib/pdk/template/fetcher.rb', line 63 def path @path end |
#temporary ⇒ Boolean (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Whether the fetched path should be considered temporary and be deleted after use.
66 67 68 |
# File 'lib/pdk/template/fetcher.rb', line 66 def temporary @temporary end |
#uri ⇒ PDK::Util::TemplateURI (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The URI of the template that is to be fetched.
60 61 62 |
# File 'lib/pdk/template/fetcher.rb', line 60 def uri @uri end |
Instance Method Details
#fetch! ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Fetches the template directory and populates the path property
94 95 96 |
# File 'lib/pdk/template/fetcher.rb', line 94 def fetch! @fetched = true end |