From: Caleb Tennis Date: 2005-11-26T02:57:01+09:00 Subject: Re: Newbie Mixin Problem On Friday 25 November 2005 12:47 pm, jlr8 wrote: > Each Player has two Strategies and Boards represent these. When > creating a Board instance I can use validIndex?, however when creating > a Strategy or Player (which creates new Boards) I get: > > NoMethodError: undefined method `validIndex?' for Board:Class It looks to me like you're calling validIndex? on Board, and not on an instance of a Board. Consider this code: irb(main):001:0> Object.foo NoMethodError: undefined method `foo' for Object:Class from (irb):1 irb(main):002:0> a = Object.new => # irb(main):003:0> a.foo NoMethodError: undefined method `foo' for # See the difference in the errors? Also, you can simplify your code a little bit: def validIndex?(index) return index.between?(0, MAX_ENTRIES) end