Interface actions should be represented by an object
|Affected Puppet version:||Branch:|
This will allow us to define meta-data about an action, such as description and its options.
#1 Updated by Daniel Pittman about 2 years ago
When we implement this we should have two objects involved in the process:
class Action attr_accessor :desc, :whatever, :else end class Action::Builder def self.build @action = Action.new builder = Action::Builder.new(@action) builder.instance_eval(...) end def desc(text) @action.desc = text end end
This gives us a nice separation between syntax sugar and clean API; using the same name for the accessor on the instance, and the sugar method on the builder, means that we have consistent naming and don’t surprise people.