Class: PuppetX::Puppetlabs::Registry::RegistryPathBase Private
- Inherits:
-
String
- Object
- String
- PuppetX::Puppetlabs::Registry::RegistryPathBase
- Defined in:
- lib/puppet_x/puppetlabs/registry.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.
This is the base class for Path manipulation. This class is meant to be abstract, RegistryKeyPath and RegistryValuePath will customize and override this class.
Direct Known Subclasses
Instance Attribute Summary collapse
- #path ⇒ Object readonly private
Instance Method Summary collapse
- #access ⇒ Object private
-
#aliases ⇒ Object
private
This method is meant to help setup aliases so autorequire can sort itself out in a case insensitive but preserving manner.
- #ascend ⇒ Object private
- #canonical ⇒ Object private
-
#initialize(path) ⇒ RegistryPathBase
constructor
private
A new instance of RegistryPathBase.
- #root ⇒ Object private
- #subkey ⇒ Object private
-
#valid? ⇒ Boolean
private
The path is valid if we’re able to parse it without exceptions.
Constructor Details
#initialize(path) ⇒ RegistryPathBase
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 RegistryPathBase.
56 57 58 59 60 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 56 def initialize(path) @filter_path_memo = nil @path ||= path super(path) end |
Instance Attribute Details
#path ⇒ Object (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.
54 55 56 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 54 def path @path end |
Instance Method Details
#access ⇒ Object
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.
80 81 82 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 80 def access filter_path[:access] end |
#aliases ⇒ Object
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 is meant to help setup aliases so autorequire can sort itself out in a case insensitive but preserving manner. It returns an array of resource identifiers.
76 77 78 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 76 def aliases [canonical.downcase] end |
#ascend ⇒ Object
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.
92 93 94 95 96 97 98 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 92 def ascend p = canonical while idx = p.rindex('\\') # rubocop:disable Lint/AssignmentInCondition p = p[0, idx] yield p end end |
#canonical ⇒ Object
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.
69 70 71 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 69 def canonical filter_path[:canonical] end |
#root ⇒ Object
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.
84 85 86 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 84 def root filter_path[:root] end |
#subkey ⇒ Object
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.
88 89 90 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 88 def subkey filter_path[:trailing_path] end |
#valid? ⇒ Boolean
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.
The path is valid if we’re able to parse it without exceptions.
63 64 65 66 67 |
# File 'lib/puppet_x/puppetlabs/registry.rb', line 63 def valid? (filter_path && true) rescue StandardError false end |