Issue #6814 has been updated by Daniel Pittman.

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.  
----------------------------------------
Bug #6814: Interface actions should be represented by an object
https://projects.puppetlabs.com/issues/6814

Author: Nick Lewis
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


This will allow us to define meta-data about an action, such as description and 
its options.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to