This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:
- For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an
action_class do ... end
block. - The 12.5 resources allow for a shorthand notation in provider code where you can refer to properties by their bare name
my_property
and it works most of the time. Since it does not work all the time (because of the way ruby scopes things), its recommended to stick to referring to properties bynew_resource.my_property
.
You cannot subclass, and must use mixins for code-sharing (which is really a best practice anyway -- e.g. see languages like rust which do not support subclassing).
in resources/whatever.rb: