What are the reasons for using Inheritance and Composition. Speaking of Inheritance, we refer to class, for Composition we refer to Module. We should know the main idea from this design. Why…
Category: Ruby On Rails
Improving performance using Enumerator::Lazy
One of the performance matter we usually encounter is Enumerator. Today, I introduce you a kind of performance issue we ever faced about enumerator. That’s Enumerator in ruby. The case is when…
Four Meta-Design Patterns in ruby
1. Separating out the things that change from those that stay the same. Obviously, we do it to avoid the tight coupled code, get it easy to make changes with less cost….
Setting up test environment and testing Model using Rspec
Ruby on Rails and automated testing are going together, hand in hand. As many language programming, Rails has it’s own testing framework. It support automatically to create boilerplate test files. Yes, many…
Ruby hook methods – meta-programming
Hook methods is actually the convenient way to help us extend the behaviors of existing class at runtime. In rails there are many popular hook methods we often use such as “included,…
How to upgrade rails
Each version, rails will have different updates. Rails is just a framework so the differences here are syntaxes. In a project, the syntaxes are not only in source code but also in…
Ruby on rails with programing to interface pattern
Developing methods of class for other classes to use, that is interface. Interfaces should not be changed time by time. Because that is knowledge which the other classes know about this class. Those are…