From: pedro mg Date: 2006-11-07T09:35:15+09:00 Subject: simple mix-in example Hi, can we consider this is a mix-in newbie example ? We are giving a new feature to method > on our Mixin class. class Mixin def initialize(a) @a = a end def >(arg) puts "Yep!" if @a > arg end end test = Mixin.new(3) test > 1 # -> Yep! test.> 1 # -> Yep! test.>(1) # -> Yep! puts "Yep, too!" if 2 > 1 # -> Yep, too! puts "not now!" if teste < 1 # -> * * undefined method `<' for # (NoMethodError) Works as expected. Thanks, -- pedro mg ruby 1.8.4 (2005-12-24) [i486-linux] irb 0.9.5(05/04/13) Linux xubuntu 2.6.17-10-generic #2 SMP i686 GNU/Linux