Class: Puppet::Util::ProviderFeatures::ProviderFeature
- Includes:
- Puppet::Util, Docs, MethodHelper
- Defined in:
- lib/puppet/util/provider_features.rb
Overview
The class that models the features and handles checking whether the features are present.
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, #nodoc?, #pad, scrub
Methods included from MethodHelper
#requiredopts, #set_options, #symbolize_options
Methods included from Puppet::Util
activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, 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/puppet/util/provider_features.rb', line 27 def initialize(name, docs, hash) self.name = symbolize(name) self.docs = docs hash = (hash) (hash) end |
Instance Attribute Details
#docs ⇒ Object
Returns the value of attribute docs.
13 14 15 |
# File 'lib/puppet/util/provider_features.rb', line 13 def docs @docs end |
#methods ⇒ Object
Returns the value of attribute methods.
13 14 15 |
# File 'lib/puppet/util/provider_features.rb', line 13 def methods @methods end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/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/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 |