Eloquent Ruby Note
By Jiazhen Xie | 23 March 2014
Tags: ruby, programming, learning
Notes ===== Use Hash if would like to search Cancel the new line kind_of?, which will return true if the object is an instance of DocumentIdentifier or a subclass of DocumentIdentifier include module, inject a super class to the object When you tack a block onto the end of a method call, Ruby will package up the block as sort of a secret argument and (behind the scenes) passes this secret argument to the method. Inside the method you can detect whether your caller has actually passed in a block ...
← Back to Home