Runtime Extends with Ruby

ruby
Ruby is a dynamic language which supports many ways to organize logic. We can use class inheritance or/and compose our classes by including selected modules (mixins). We can define or undefine methods on the fly. We can even use methods that aren’t really defined (using method_missing).
Another powerful feature is its ability to extend object with new methods in run-time by including modules to its class or its singleton class (if he/she wants to extend only the one object).

To present this design pattern, lets assume that we want to create an application which will entertain our users — an RPG game, where the plot takes place in a fantasy world.

Continue reading

3D Buttons with CSS3 gradients and Sass

Visiting various pages on the web, we often see nice buttons looking like they are 3d. In most cases those buttons are being made with image – gradients. CSS3 allows us to create gradients without images, speeding up development and page-loading time. Another important factor is their flexibility to change color and ability to scale with their containers. Trying other colors for image-based buttons means changing colors of corresponding gradient-images, what surely is a time-consuming process.


Continue reading