In some work on the indirector, I noticed that many (most? all?)
instance methods do not return self, so that you can't easily chain
results together. For example:
A.new("arg1", "arg2").method1.method2
doesn't work. Instead, I saw code like this:
result = A.new("arg1", "arg2")
result.method1
result.method2
where method1 and method2 are being used for side effects (and
culturally, should end with exclamation points so that their
side-effect nature is explicit -- however, that's a secondary issue).
This patch refactors lib/puppet/node/facts.rb to return self and
lib/puppet/indirector/facts/facter.rb's find() method to demonstrate
this. Modified tests are included as well.
Do others find this refactoring useful?
Thanks,
Steven
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---