31 Jul '14, 11am

Meditations on a Class Method

I keep a file of code I like. When looking for inspiration, I read through the file. It’s short; I often re-write the samples to be nothing but the minimally inspiring thought. Here is the first snippet: def self.run(user) new(user).run end Think on it for yourself before I explain what it means to me. I’d like to hear what it means to you — leave a long comment here before you keep reading. To me, it’s a reminder of how to write a beautiful class method: instantiate the class then call a method on the instance. Look at it from the perspective of the person calling the class method. When you call a class method you want one of two things: either you want to construct an instance of the class itself (.new , or perhaps .new_from_file , .new_for_widescreen , and .new_from_json ), or you want convenience. Think of the class methods you’ve seen, or have written. If they are not...

Full article: http://robots.thoughtbot.com/meditations-on-a-class-method

Tweets

WATCH: Use this #yoga class to build power in y...

runnersworld.com 31 Jul '14, 9pm

CLASS 2: POWER YOGA Tight hammies and an achy back no more! This yoga series caters specifically to a runner's most overus...

Bitcoin-to-Gold Service Faces Class Action Over Alleged Fraud

Bitcoin-to-Gold Service Faces Class Action Over...

coindesk.com 31 Jul '14, 8pm

Bitcoin-to-gold website Coinabul LLC is facing a serious federal class action alleging that it defrauded some of its clien...

5 tips for getting an upgrade to first class

5 tips for getting an upgrade to first class

aluxurytravelblog.com 02 Aug '14, 11am

So you arrive at the airport dressed as if you’ve just rolled out of bed (admittedly it might be 4 in the morning, but sti...

via Blackfive | Jesse Ventura Has No Class #Mil...

blackfive.net 29 Jul '14, 10pm

Deebow is a Staff Sergeant and a Military Police Squad Leader in the Army National Guard. In a previous life, he served in...

Mercedes launches armor-plated S Class

Mercedes launches armor-plated S Class

luxuo.com 07 Aug '14, 4pm

The S600 Guard offers everything that you would expect from a flagship Mercedes — a glorious V12 engine and levels of comf...