Method for locating yourself in space and in time

Submitted by gwolf on Mon, 08/31/2009 - 19:05

Today I had a nice and productive day, code-wise. Maybe that's a side effect from being unable to lose my time following E-mail?
Anyway, checking my code with git citool previous to today's git commit, I came accross this method. I didn't even pay attention to it while writing. But it did make me laugh in semi-awe thinking about the great implications it might have. The method signature:

def days_for(who, what, how)

The code itself? Naah, too pedestrian, to simplistic. It will ruin the sight. It just looks so beautifully universal!

Ok, I am compelled to share, even if it spoils it and renders it into a completely regular, even stupid method.

  1. def days_for(who, what, how)
  2. return ' —No dates set— ' unless who.has_validity_period?
  3. days_to = who.send(how)
  4. return 'Past' if days_to <= 0
  5. '%d days (%s)' % [days_to, who.send(what)]
  6. end

( categories: )
almost Anonymous's picture

now u are able to find

now u are able to find yourself? r u sure? you will never be lost again? congratulations!!!!!!!!