26 Apr '13, 5am

I came to this thread by googling for "verbs used in method names ruby"

On Tue, Jan 18, 2011 at 9:16 AM, Edmond Kachale <[email protected]> wrote: > Rubists, > > What is the most recommended (or the conventional) way of naming methods in > Ruby? Do they need to be verb-like or noun-like? In other language like C++, > methods are supposed to be verbs because they are dimmed as messages sent to > the object. I have asked this because methods in Ruby are also objects. Well, I can't speak for Rubyists in general, but I aim for the following: - methods that do something should be verbs: obj.calculate obj.set_name obj.get_date - methods that are accessors (or behave like them) should be nouns: foo = obj.name puts obj.date obj.calculation - Interrogative methods get phrased as questions: obj.date_today? obj.name? obj.calculation_done? - methods that modify the object (or caller) itself, should be exclamations: obj.truncate! obj.remove_n...

Full article: http://www.ruby-forum.com/topic/898325

Tweets

Ruby 2.0 has been released and @rubinius has st...

rubini.us 26 Apr '13, 3pm

The Rubinius team is now focused on pushing Rubinius into the hands of all developers. To that end, the current highlevel ...

@peterc Many thanks for mentioning our courses ...

rubyweekly.com 25 Apr '13, 3pm

Parsing JSON The Hard Way From the Practicing Ruby journal comes an excellent walkthrough of building a JSON parser from A...

Ruby's timeout is a disaster for multi-threaded...

blog.headius.com 19 Apr '13, 5pm

(NOTE: Due to an issue migrating my blog from one Google account to another, this URL now points at a *copy* of the origin...

#coffee

coffeegeek.com 27 Apr '13, 12am

I have seen plenty of ways of approaching both of these brewers, but wanted to share my approach which is the results of l...

Does a #python library already exist that adds ...

api.rubyonrails.org 26 Apr '13, 2pm

mb_chars is a multibyte safe proxy for string methods. In Ruby 1.8 and older it creates and returns an instance of the Act...