Class: Puppet::Util::ProviderFeatures::ProviderFeature
- Includes:
- Puppet::Util, Docs, MethodHelper
- Defined in:
- lib/vendor/puppet/util/provider_features.rb
Overview
The class that models the features and handles checking whether the features are present.
Constant Summary
Constants included from Docs
Constants included from Puppet::Util
AbsolutePathPosix, AbsolutePathWindows
Instance Attribute Summary collapse
-
#docs ⇒ Object
Returns the value of attribute docs.
-
#methods ⇒ Object
Returns the value of attribute methods.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes included from Docs
Instance Method Summary collapse
-
#available?(obj) ⇒ Boolean
Are all of the requirements met?.
-
#initialize(name, docs, hash) ⇒ ProviderFeature
constructor
A new instance of ProviderFeature.
Methods included from Docs
#desc, #dochook, #doctable, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub
Methods included from MethodHelper
#requiredopts, #set_options, #symbolize_options
Methods included from Puppet::Util
absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, #execfail, #execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, uri_to_path, wait_for_output, which, withumask
Methods included from Puppet::Util::POSIX
#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid
Constructor Details
#initialize(name, docs, hash) ⇒ ProviderFeature
Returns a new instance of ProviderFeature.
27 28 29 30 31 32 |
# File 'lib/vendor/puppet/util/provider_features.rb', line 27 def initialize(name, docs, hash) self.name = name.intern self.docs = docs hash = (hash) (hash) end |
Instance Attribute Details
#docs ⇒ Object
Returns the value of attribute docs.
13 14 15 |
# File 'lib/vendor/puppet/util/provider_features.rb', line 13 def docs @docs end |
#methods ⇒ Object
Returns the value of attribute methods.
13 14 15 |
# File 'lib/vendor/puppet/util/provider_features.rb', line 13 def methods @methods end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/vendor/puppet/util/provider_features.rb', line 13 def name @name end |
Instance Method Details
#available?(obj) ⇒ Boolean
Are all of the requirements met?
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vendor/puppet/util/provider_features.rb', line 16 def available?(obj) if self.methods return !!methods_available?(obj) else # In this case, the provider has to declare support for this # feature, and that's been checked before we ever get to the # method checks. return false end end |