From: Logan Capaldo Date: 2006-02-09T09:36:16+09:00 Subject: Re: how to create singleton methods in script On Feb 8, 2006, at 7:16 PM, charlie bowman wrote: > The following code works but it's awfully ugly putting a method at the > top of a script. Is this really how I have to structure a script? Well yes and no. If you stick display_bad_action in the TimeKeeper class it doesn't matter whether you call it from another method before it "sees" the definition. The rule is, before you call a method (at runtime chronologically, not necessarily before you type the code to call the method) it must be defined. so class A def a b end def b puts "B called" end end a = A.new a.a is fine.