For some reason I find
class X
Ick::Let.belongs_to self
end
rather unappealing so I added this to sugar.rb:
module Ick
module Sugar
def self.const_missing( const )
sugar_module = Module.new
sugar_module.module_eval "
def self.included( base )
Ick.const_get( :#{const} ).belongs_to base
end
"
sugar_module
end
end
end
and now do:
class X
include Ick::Sugar::Let
end
which seems easier on my eye somehow. Of course it's probably grotesque somehow, I can't decide.
|