« Retrieving a sensible file extension for a given MIME string in Rails | Main | As easy as passing on a link »

February 28, 2007

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e398212d6f883300e3982163008833

Listed below are links to weblogs that reference Class (re)definition in method body:

Comments

kamal

A more idiomatic way to rewrite to_s would be

def to_s
"*" * self
end

If you really did want to go the string concatenation way, using << would be more memory efficient too :)

choonkeat

ah.. neat! thanks kamal!

Herry

Like that oso can? Thanks for sharing man.

Deepak Jois

http://webjazz.blogspot.com/2007/03/overriding-timenow-for-rails-testing.html

A more elegant way, perhaps! :)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

My Other Stuff

Blog powered by TypePad