def has_just_one_kind_of_thing?(item, controller)
        if (controller == 'foos' && item.widgets.blank?) || (controller == 'foos' && item.doohickeys.blank?) || (controller == 'bars' && item.widgets.blank?) || (controller == 'bars' && item.doohickeys.blank?) || (controller == 'bazes' && item.widgets.blank?) || (controller == 'bazes' && item.contraptions.blank?)
...

Ruby 6 embarassingly ugly line m...

by chrisadams.me.uk, November 23, 2009 01:16, 3 refactorings, tagged with ruby, case, when

Hi everyone,

I'm trying ...

9c5f7685501ec87178055f41147c75c5 Talk
stuff.each do |name|
  name = name.downcase
  #size
...

Ruby ungliness and long too

by uberholden.myopenid.com, September 10, 2009 13:15, 6 refactorings, tagged with rails, ruby, if, case, if else

any ideas on making this mo...

55502f40dc8b7c769880b10874abc9d0 Talk
var search = 'foo';
var key = null;
...

JavaScript Javascript Switch Statement

by 파이어준, March 16, 2009 06:00, 6 refactorings, tagged with javascript, case, switch

help me produce better code?

9e2c437fb89b21498e262788e45b20c8 Talk
public function setClass($class){
		switch($class){
			case "050":
...

PHP switch statement a good idea?

by cmcculloh, August 12, 2008 18:19, 5 refactorings, tagged with php, case, switch

I'm making a switch stateme...

298e0497aa6b76a573f17e6a2bb22dec Talk