Calamity Lane

Curious Code for Curious Coders

Code Lyrical III

1
2
3
4
5
6
7
8
9
10
11
12
13
class Object
  alias old_is_a? is_a?
  def is_a?(klass)
    if klass == Thing
      return self.respond_to?(:that_swing)
    end
    old_is_a?(klass)
  end
end

if it.is_a? Thing
  8.times(doo_wah)
end

Answer after the jump.

“It Don’t Mean A Thing (If It Ain’t Got That Swing)” by Duke Ellington and Ella Fitzgerald

It don't mean a thing if it ain't got that swing,
doo-wah, doo-wah, doo-wah, doo-wah, doo-wah, doo-wah, doo-wah, doo-wah