19 Jun '12, 10pm

It is time for your infrequent reminder about bang (!) methods in Ruby: "Bang methods; or, Danger, Will Rubyist!"

In Ruby, you can write methods whose names end in ! (exclamation point or “bang”). There’s a lot of confusion surrounding the matter of when, and why, you would want to do so. What ! does (and does not) mean The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub . exit! is the dangerous version of exit . flatten! is the dangerous version of flatten . And so forth. The ! does not mean “This method changes its receiver.” A lot of “dangerous” methods do change their receivers. But some don’t. I repeat: ! does not mean that the method changes i...

Full article: http://dablog.rubypal.com/2007/8/15/bang-methods-or-dange...

Tweets

#rails have some interesting methods some times.

apidock.com 20 Jun '12, 9am

i_suck_and_my_tests_are_order_dependent! () public Call this at the top of your tests when you absolutely positively need ...

Time#strftime - see also – similar methods #ruby

apidock.com 28 Jun '12, 6pm

m blank-padded ( 1..12) %-m no-padded (1..12) %B - The full month name (``January'') %^B uppercased (``JANUARY'') %b - The...

Date#strftime - see also – similar methods #ruby

apidock.com 28 Jun '12, 6pm

m blank-padded ( 1..12) %-m no-padded (1..12) %B - The full month name (``January'') %^B uppercased (``JANUARY'') %b - The...

DateTime#strftime - see also – similar methods ...

apidock.com 28 Jun '12, 6pm

m blank-padded ( 1..12) %-m no-padded (1..12) %B - The full month name (``January'') %^B uppercased (``JANUARY'') %b - The...

OHBULAN!: Monday Music : MV Terbaru Big Bang Berjudul "Monster" Terbaik!

OHBULAN!: Monday Music : MV Terbaru Big Bang Be...

ohbulan.com 19 Jun '12, 4am

Pilihan OHBULAN! untuk segmen Monday Music minggu ini pastinya ialah K-Pop. Muzik video terbaru Big Bang yang dilancarkan ...

Jay Fields' Thoughts: Ruby: Class Methods:

Jay Fields' Thoughts: Ruby: Class Methods:

blog.jayfields.com 17 Jun '12, 5am

The real stumbling block is that Java class methods are totally different things from Ruby "class" methods, so different t...