$ gem install guessmethod -y
> require 'rubygems'
> require 'guessmethod'
> class Object; include GuessMethod; end # though this could go in the guessmethod.rb file in the gem
> class Product; def name; "Some product"; end; end
attention: replacing non-existant constant Prodct with Product for Objectattention: sending new instead of nw to Product:Classattention: sending name instead of nae to #<Product:0x144ff10>:Product
=> "Some product"
That’s going straight into my .irbrc file. My bad spelling, coupled with my British/Australian English, will never slow me down again!
UPDATE: actually, it doesn’t like being in the .irbrc file for Rails console; so in the config/environments/development.rb files will have to do for the moment.
Meta-magic in a programming language is as important to programmers as changeable ring tones are to teenagers. Authors of programming languages cannot provide every feature to everyone, so it is so wonderful to be able to add new language features and extensions that you want. Everyone knows you can add Jessica Simpson as your mobile ring tone, but not all programmers know that you can add new features to their programming world.
So here is an overview to a new world of happiness. It also overviews how the Magic Models work, and introduces a new gem I’m working on – the Magic Wiggly Lines – described as “genius or insane”