Not on the method itself, but on the return value of the method call, which is the appropriate browser class "as determined by the configuration settings."
Richard -- Richard Lawrence Certified Scrum Coach Founder and Principal Consultant, Humanizing Work, LLC 303-895-7688 rich...@humanizingwork.com www.humanizingwork.com www.richardlawrence.info On Tue, Jan 6, 2009 at 10:46 AM, aidy lewis <aidy.le...@googlemail.com> wrote: > > Hi > > Can anyone please tell me why the new operator (klass.new) here is > used on what looks like a private method? > > # Create a new instance of a browser driver, as determined by the > # configuration settings. (Don't be fooled: this is not actually > # an instance of Browser class.) > def new > set_sub_options > klass.new > end > # Create a new instance as with #new and start the browser on the > # specified url. > def start url > set_sub_options > klass.start url > end > def klass > key = Watir.options[:browser] > eval @@browser_classes[key] # this triggers the autoload > end > private :klass > > Thanks > > Aidy > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---