On Fri, Dec 5, 2008 at 3:38 PM, Luke Kanies <[EMAIL PROTECTED]> wrote:
>
> On Dec 5, 2008, at 4:43 PM, Nigel Kersten wrote:
>> +
>> +    mk_resource_methods
>
> This method...
>
>> +    properties =
>> [  :allow_root, :authenticate_user, :auth_class, :comment,
>> +
>>                     :group
>> , :k_of_n, :mechanisms, :rule, :session_owner,
>> +                    :shared, :timeout, :tries ]
>> +
>> +    properties.each do |field|
>> +        define_method(field.to_s) do
>> +            retrieve_value(resource[:name], field)
>> +        end
>> +
>> +        define_method(field.to_s + "=") do |value|
>> +            @property_hash[field] = value
>> +        end
>> +    end
>
> ...basically does this for you.  You'd have to check specifics, but
> I'm pretty sure you can just use the method, and it'll skip the
> auth_type reader, as long as you call the method after the reader is
> defined.
>
> It's fine either way, just figured I'd point it out.
>
> Otherwise, seems good.

ok. I'll poke at that a bit, as I was under the impression I wouldn't
be able to use mk_resource_methods with the readers the way I've
defined them to use my internal method
"retrieve_value(resource[:name], field)"

I should have actually removed that, I missed it in my cleanup.


>
> --
> It's not that I'm afraid to die. I just don't want to be there when it
> happens. -- Woody Allen
> ---------------------------------------------------------------------
> Luke Kanies | http://reductivelabs.com | http://madstop.com
>
>
> >
>



-- 
Nigel Kersten
Systems Administrator
Tech Lead - MacOps

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com
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