From: Junayeed Ahnaf Nirjhor Date: 2011-10-19T15:44:28+09:00 Subject: Custom Method not running ------=_NextPart_000_0011_01CC8E5C.D3543B70 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, =20 Why this code is not running, anyone ? =20 def dictionary_sort arr return arr if arr.length <=3D1 middle =3D arr.pop less =3D arr.select{|x| x.downcase < middle.downcase} more =3D arr.select{|x| x.downcase >=3D middle.downcase} sort(less) + [middle] + sort(more) end words =3D ['can','feel','singing.','like','A','can'] puts(dictionary_sort(words).join(' ')) =20 Error is following: =20 C:/Users/Nirjhor/RubymineProjects/dictionary sort.rb:20:in = `dictionary_sort': undefined method `sort' for main:Object = (NoMethodError) from C:/Users/Nirjhor/RubymineProjects/dictionary = sort.rb:23:in `' from -e:1:in `load' from -e:1:in `
' =20 Peace be upon you =E2=80=93 Junayeed Ahnaf Nirjhor Twitter - @Nirjhor =20 =20 ------=_NextPart_000_0011_01CC8E5C.D3543B70--