/explore
|
You are here |
thepugautomatic.com | ||
| | | | |
thomascountz.com
Adding Functionality to Client Classes The first step in tackling this problem is to add functionality to a model class. If we have a class Book, we want to add a class method Book.find , and some instance methods book#title, book#author, and book#isbn, without needed to explicitly write them, like we did in the original spike. A Note on Mix-Ins & Inheritance When you want to create a model with ActiveRecord, you have to inherit from the Base module: class Book < ActiveRecord::Base; end There are endless debates about composition v. inheritance, and, from my perspective, they all mostly lean towards composition, but what about using mix-ins versus using string inheritance? In Ruby, inheriting and including a module both add a new entity in the method look-up... |
|
| | | | | ||
| | | | |
dejimata.com
Tokyo-based developer chronicling life in words and code. |
|
| | | | | ||
| | | | |
honnef.co
[AI summary] The article explains how to dynamically define instance methods in Ruby using eigenclass eval and the define_method function. |
|
| | | | | ||
| | | | |
www.s-anand.net
In 1994, I learnt Perl. It was fantastic. I used it to: In 2006, I was convinced I should stick to Perl over Python. In 2008, Google launched AppEngine and it provided free hosting (which was a big deal!) but had only 2 runtimes: Java and Python. The choice was clear. I'd rather learn Python ... Perl, 1994-2011 Read More ยป |
|
| | | |||