On Nov 9, 2008, at 3:47 AM, Brice Figureau wrote:
> + # don't fetch lexer comment by default
> + def use_docs
> + false
> + end
> +
> + # allow our subclass to specify they want documentation
> + class << self
> + def associates_doc
> + define_method("use_docs") do
> + true
> + end
> + end
> + end
> +
This could be done more easily like this:
def use_docs
self.class.use_docs
class << self
attr_accessor :use_docs
def associates_doc
self.use_docs = true
end
end
That is, use a class attribute, rather than dynamically redefining the
method.
Otherwise, the patch looks good.
--
Sapolsky's First Law:
Think logically, but orthogonally.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---