From: Raju Gandhi Date: 2012-05-02T04:12:29+09:00 Subject: Re: assert_equal ([:r, :u, :b, :e, :q, :u, :e] __), [:b, :q] --0016e6d64182f307ad04befe59cb Content-Type: text/plain; charset=ISO-8859-1 Hey David, Perhaps it has to do with certain operations that you can do with arrays in Ruby ... Remember that Ruby provides syntactic sugar for certain kinds of methods ... So, for e.g def name= (name) @name = name end can be invoked as .name = "David" What Ruby does here is that it sees an assignment (name = "David") and looks for a method called name= (Note there is no whitespace between name and "="). I bring this up b/c it seems that you are thinking of a method that you could use here ("I don't understand the above because the blank is not right up against the .. array"). And the solution lies in invoking a method on an array, but with the syntactic sugar applied. Look at http://www.ruby-doc.org/core-1.9.3/Array.html and look at any mathematical operators that might come in handy - see how they are to be used. Hope that helps. Raju On Tue, May 1, 2012 at 2:55 PM, David Gustafson wrote: > This is part of a online ruby quiz. Just doing it for my own > education, not on a test that I'm graded on. > > assert_equal ([:r, :u, :b, :e, :q, :u, :e] __), [:b, :q] > > I don't understand the above because the blank is not right up against > the [:r, :u, :b, :e, :q, :u, :e] array. I'm not sure how to search > for whatever is supposed to be in the blank. > > If someone could give me a hint rather than an answer it would be > appreciated. > > -- > Doubt is not a pleasant condition, but certainty is absurd. > -- Voltaire > > --0016e6d64182f307ad04befe59cb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey David,

Perhaps it has to do with certain operations that you can= do with arrays in Ruby ... Remember that Ruby provides syntactic sugar for= certain kinds of methods ... So, for e.g

def name=3D (name)
=A0 @name =3D name
end

can be invoked= as

<some_object>.name =3D "David"

What Ruby = does here is that it sees an assignment (name =3D "David") and lo= oks for a method called name=3D (Note there is no whitespace between name a= nd "=3D").

I bring this up b/c it seems that you are thinking of a method that you= could use here ("I don't understand the above because the blank i= s not right up against
the .. array"). And the solution lies in invoking a method on an array= , but with the syntactic sugar applied.

Look at http://www.ruby-doc.org/core-1.9.3/A= rray.html and look at any mathematical operators that might come in han= dy - see how they are to be used.

Hope that helps.

Raju


--0016e6d64182f307ad04befe59cb--