I’m continuing my look at Ruby Facets today, this time looking at another Hash method. I use Hashes everyday in Rails programming so if I can pick up some new techniques, I can put them to use right away. Today’s subject is Hash#zipnew. The Code 1 2 3 4 5 6 # File lib/core/facets/hash/zipnew.rb, line …
Code Reading – New Ideas and New Solutions
My daily refactorings have improved my existing code up to my current knowledge of Ruby. Now I need a way to learn new ideas and ways to write Ruby. I’m going to start doing a daily code reading and review every day: posting it reading over it taking notes on the interesting techniques try to …
Daily Code Reading #1 – Facets Hash#autonew
I’m starting this series by taking a look at Ruby Facets. Facets is a collection of Ruby core and Ruby standard library extensions. It has a lot of good code embedded in it from many contributors so it should be a good place to start looking for some new ideas. The Code 1 2 3 …
Pausing Daily Refactors
After almost four months of daily refactors, I’ve decided to pause them. They have been very successful and helped me overcome a lot of the fears I’ve had with programming. I just feel that they have lost some of their value now and I want to move on to another interesting idea for self training. …
Daily Refactor #81: Move last_invoice_number to Model
The Refactoring Today I used move method on the InvoiceController to move the #last_invoice_number to the Invoice model Before 1 2 3 4 5 6 7 8 class InvoiceController 'id DESC') unless last_invoice.nil? last_invoice.invoice_number else '-' end end endclass InvoiceController 'id DESC') unless last_invoice.nil? last_invoice.invoice_number else '-' end end end 1 2 3 class Invoice …