Ruby Blocks Tutorial
Sometimes we need to make our code more expressive and tidy but at the same time flexible and easier to use. Learning how to use Ruby blocks appropriately will level you up as a Ruby programmer. Sometimes we like to...
Read MoreSometimes we need to make our code more expressive and tidy but at the same time flexible and easier to use. Learning how to use Ruby blocks appropriately will level you up as a Ruby programmer. Sometimes we like to...
Read MoreGeneral rule of thumb is if you have a collection of objects, you should build custom iterators so that users could readily use them like they do with other collection such as Array, Hash, File, etc. The easiest way to do this...
Read MoreGenerally if your class has an array/hash, sometimes you don’t want to expose the implementation of those collections outside of the object. Creating your own iterator will make your object easier to use. class Headphone...
Read MoreSometimes the scope of a local variable is a bit confusing when working with blocks. For example, the following will result in an “undefined local variable” for variables “x” and “bacon”...
Read MorePosted by Jay Luong | Feb 2, 2017 | MySQL / Percona, Vim |
When given a comma or tab-delimited file, we usually want to import this into some kind of database. The first you need to find out is what type of file this is as it could make or break your import. g _ – goes to the...
Read More
Recent Comments