aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorClinton R. Nixon2009-09-22 13:03:46 -0400
committerMax Howell2009-09-24 18:26:16 +0100
commit2668e2aeffb6c77cf29cec01b5c02a3077133227 (patch)
tree452b653cd98c54eb6639ee8c7c3185f3b12752af /Library/Homebrew/utils.rb
parent44a3d59630fddaa45767174c35ed410984eeb60b (diff)
downloadbrew-2668e2aeffb6c77cf29cec01b5c02a3077133227.tar.bz2
DRYed up "@foo=self.class.foo unless @foo" statements
Using the example from the existing code: CHECKSUM_TYPES.each do |type| if !instance_variable_defined?("@#{type}") class_value = self.class.send(type) instance_variable_set("@#{type}", class_value) if class_value end end I extracted that block into a method 'set_instance_variable' which I then used in all places where this behavior was being used.
Diffstat (limited to 'Library/Homebrew/utils.rb')
0 files changed, 0 insertions, 0 deletions