The latest news in the Ruby and Rails community.

Subscribe to our mailing list!

Episode #396

August 20th, 2013

Rails 4.1 feature call, Bundler local paths, multi-table full text search in Postgres, handy predicates, strong parameters by example, merged docs for Ruby 2.0 & Rails...


Know Thy Predicates

Ruby, like most programming language allows people to write conditionals to determine whether: an integer is odd or even, greater than another, or between two integers. Except in many cases there are better ways to do this in a more object-oriented way using the predicate methods defined on core ruby classes like Fixnum. And that’s exactly what Bozhidar Ivanov Batsov demonstrates a neat blog post called Know Thy Predicates. Many of these predicates tend to make your code more expressive. Although as Bozhidar mentions in the post, they require you to be careful about the risk of calling these methods on nil since your conditional will explode with a NoMethodError instead of false.

Visit site → Permalink

Previous Episodes

Episode #395

What the duck is going on? A lot of C programming on on Ruby5? Having fun fiddling around and looking at the clouds.

Episode #394

Index attachments on Elasticsearch, Refinery 2.1 released, Conditionals Aren't Evil, Disable Postfix on OS X, validate with Mutations and take snapshots of your commit faces with LOLCOMMITS.

Episode #393

In today's episode, learn about the initializing and, get responsible with your refactoring, simplify your regular expression creation, get skeuomorphic with your credit card forms and so much more! Actually, just one more thing: two-factor authentication done easy. Now there's no more!

Episode #392

Reparing BREACH in Rails, Using state_machine with Authority, AR-JDBC 1.3 RC, developing with UltraHook, Running specs from Vim and using emojis on your RSpec output

View the archives →

Looking to learn about Ruby? Take a look at the Ruby Path on Code School

This podcast is produced and distributed by Code School. Copyright © 2015 Code School LLC