On Mon, Sep 10, 2012 at 12:23:30PM -0400, Trevor Vaughan wrote:
> Thanks Stefan,
> 
> I toyed around with that idea a bit but, at this point, the code is SO
> much clearer/cleaner in the 'initialize' define that I think it will
> become my preferred method of doing this type of thing and I couldn't
> quite get it to work with what I wanted to do since I really just
> want:
> 
> some_type { 'meaningless_name':
>    foo => 'stuff',
>    bar => 'other stuff',
>    baz => 'more stuff'
> }
> 

If the title is not supposed to set your namevars and your namevars
should be set explicitly, then map your title only to foo. This way you can
define default values for bar and baz and you should even get a failure
if a namevar is not set by the user in case there is no default:

def self.title_patterns
  [
    [
      /^(.*)$/,
      [
        [:foo, lambda{|x| x }],
      ]
    ]
  ]
end

-Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to