Previous page: Daily Crap 2009-05-19
Next page: Daily Crap 2009-05-24


Daily Crap 2009-05-23

  1. What?? This prints "hi" twice:

    module A
      def go
        puts "hi"
      end
    
      class B
      end
    end
    
    include A
    
    B.new.go
    A::B.new.go

    This fails with NoMethodError:

    module A
      def go
        puts "hi"
      end
    
      class B
      end
    end
    
    A::B.new.go

Comments

Click here to view the comments on this post.