brain.rbinstance_missing
Just a little something i did, cause it usually takes me about 15 minutes to calculate a percentage conversion.
is anyone else checking/calculating dates in irb/console?
“Elad, in 2 weeks you have a dentist appointment!”
"mmm…. "<br /> script/runner 'puts 2.weeks.from_now'<br />
hehe,
but the method today’s post is about, is the percent_from i did, so here it is.<br />class Numeric<br /> def precent_from(num = 100)<br /> self.to_f * (num.to_f / 100.0)<br /> end<br />end<br />
which comes out as:<br />>> 40.precent_from(1000)<br />=> 400.0<br />>> 6.precent_from(1000)<br />=> 60.0<br />
| Variable | Value |
|---|---|
| GITHUB | |
| WWR | { :working_with_rails => 'http://www.workingwithrails.com/person/5844-elad-meidar' } |
| IRC | { 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]} |
| SKYPE | eladmeidar |
You're seeing this error because I think it is funny.