27 Jul '12, 9am

Object#try メソッドあるときだけ呼ぶ / “try() — ones zeros majors and minors”

→ try() 26 February 2008 This is something we’re using on GitHub that I really wish I started using sooner. For lack of a better name, it’s called try() . It works like this: def remove_email ( email ) emails . find_by_email ( email ) . try ( :destroy ) end Another example: file_type = file_types . detect { | key , | name . include? key } . try ( :last ) Lucky little Io has this idea baked in: task ?invoke And, of course, Objective C has something similar . Here it is in Ruby: class Object ## # @person ? @person.name : nil # vs # @person.try(:name) def try ( method ) send method if respond_to? method end end Enjoy. [email protected] a dude who lives in san francisco and cofounded github . meta feed archive code tweets Visit the Archive (( copyright ought ten chris wanstrath ))

Full article: http://ozmm.org/posts/try.html

Tweets

Blogged at

Blogged at

missypixie.blogspot.com 02 Aug '12, 12pm

I have been wanting to blog about this for the longest time. It started with a conversation between sharmie & me about our...

ASIA TOUR DEC 2012: Kuala Lumpar, Bangkok, Shanghai, Beijing, Xian, Phuket, Manila, Jakarta, Singapore... details on

ASIA TOUR DEC 2012: Kuala Lumpar, Bangkok, Shan...

trythisforexample.com 26 Jul '12, 7pm

I'll be touring in Asia with DJ Wire in December!!! Check out all the dates below! Wed 12th December - Vertigo, Kuala Lump...

Couldn't stop smiling!!! I love Singapore! Goin...

instagram.com 28 Jul '12, 8am

@ajunaleigh @coconille @yoonaloveskpop i agree. We dont have to test on animals. But we do need to test products before we...

Looking for a good deal on a Rolex? Try online bidding for stolen goods: Looking for a good deal on a Rolex? Try...

Looking for a good deal on a Rolex? Try online ...

chron.com 27 Jul '12, 6pm

If you're looking for a steal on a fancy watch or a cool car, check out auction sites used by a growing number of Texas ci...

Want to sound like you know what you're talking...

rwdaily.runnersworld.com 26 Jul '12, 5pm

Hey, runners! Feeling left out of the "zero drop " craze? Tired of hearing your running buddies talk incessantly about "ze...

Shabaab to try, execute 3 more Somalis for 'spy...

longwarjournal.org 28 Jul '12, 4pm

The comments section is intended to provide a forum to discuss and debate current posts. The Long War Journal makes no war...

#Singapore Top new beauty products to try: We tried and tested 'em so you don't have to.

#Singapore Top new beauty products to try: We t...

shopping.insing.com 23 Jul '12, 4am

There are hundreds of new products that hit beauty counters and drugstores every month, so no matter how hard you shop, yo...

@DjJayFree try theMishka crylic. The stitch on the crown is a vibrant yellow. Nice colour match.

@DjJayFree try theMishka crylic. The stitch on ...

soleheaven.com 27 Jul '12, 5pm

If your order is received before 15:00 we will dispatch same day. Due to the limited nature of our stock we sometimes run ...

La Paz,I love the way you try to starve me of oxygen.But while I can breath a blog post

La Paz,I love the way you try to starve me of o...

hasblog.co.uk 28 Jul '12, 1pm

I write to you over Georgetown at 36000 ft traveling at a speed of 592 miles per hour. Another long haul flight does not f...

Try Some New Zealand Wines This Summer

justluxe.com 23 Jul '12, 10am

Lifestyle Try Some New Zealand Wines This Summer By: Kellie Speed | Posted on July 23, 2012 | 0 Comments There is no bette...

Runway-Ready Digits To Try for Your Next Mani

Runway-Ready Digits To Try for Your Next Mani

fashiontribes.typepad.com 31 Jul '12, 12am

When it comes to completing your look, why not finish off your mani with some inspiration from your fave catwalks & gadget...

@Zwyy try going they are blogshop posted in com...

sgspree.livejournal.com 03 Aug '12, 1pm

VERY IMPT!!! DO NOT BUST THE CAP Check to see if the spree cap has been met. If you transfer even though the cap's been me...

Heading to Fife Leisure Park in the school holidays? Why not try an Under 16's Service 19 Megarider for only £5! Info>

Heading to Fife Leisure Park in the school holi...

stagecoachbus.com 06 Aug '12, 1pm

© Copyright Stagecoach Group plc 2012 Website designed and developed by Emperor . Ticketing system powered by EH7 Internet...

Hmm should I try

Hmm should I try

chuckei.com 09 Aug '12, 5pm

Remember the last time when I went to 76style for hair treatment and Yoshi advice me not to dye my hair and let it rest......