Module: Poise::Helpers::LWRPPolyfill::Resource
- Extended by:
- ClassMethods
- Included in:
- ChefspecMatchers
- Defined in:
- lib/poise/helpers/lwrp_polyfill.rb
Overview
Provide default_action and actions like LWRPBase but better equipped for subclassing.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .actions(*names) ⇒ Object extended from ClassMethods
-
.attribute(name, opts = {})
(also: #property)
extended
from ClassMethods
Create a resource property (née attribute) on this resource class.
- .default_action(name = nil) ⇒ Object extended from ClassMethods
- .included(klass) ⇒ Object extended from ClassMethods
Instance Method Summary collapse
Class Method Details
#actions ⇒ Array<Symbol> #actions(*names) ⇒ Array<Symbol> Originally defined in module ClassMethods
.attribute(name, opts = {}) Also known as: property Originally defined in module ClassMethods
This method returns an undefined value.
Create a resource property (née attribute) on this resource class. This follows the same usage as the helper of the same name in Chef LWRPs.
#default_action ⇒ Array<Symbol> #default_action(name) ⇒ Array<Symbol> Originally defined in module ClassMethods
.included(klass) ⇒ Object Originally defined in module ClassMethods
Instance Method Details
#initialize(*args) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/poise/helpers/lwrp_polyfill.rb', line 33 def initialize(*args) super # Try to not stomp on stuff if already set in a parent. Coerce @action # to an array because this behavior may change in the future in Chef. @action = self.class.default_action if Array(@action) == [:nothing] (@allowed_actions << self.class.actions).flatten!.uniq! end |