From: Siratinee Sukachai Newsgroups: comp.lang.ruby Subject: error: undefined method Date: Thu, 21 Apr 2011 02:55:25 -0500 Organization: Service de news de lacave.net Lines: 29 Message-ID: <0bfc818aaade1cf1852b483c69c7074b@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1303372558 9169 65.111.164.187 (21 Apr 2011 07:55:58 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 21 Apr 2011 07:55:58 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 381983 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <0bfc818aaade1cf1852b483c69c7074b@ruby-forum.com> Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!feed.ac-versailles.fr!talisker.lacave.net!lacave.net!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3297 I create a method named splitDot which is spliting a dot "." Inside a class, I call that method but I got the error. This is the full error: app/controllers/convert_to_yaml.rb:14: undefined method `splitDot' for ConvertToYaml:Class (NoMethodError) from app/controllers/convert_to_yaml.rb:13:in `each' from app/controllers/convert_to_yaml.rb:13 My method: private def splitDot(s) return s.split('.') end And I call the method like this: text.each{|t| array = splitDot(t) } Any suggestions? -- Posted via http://www.ruby-forum.com/.