From: Raju Gandhi Date: 2012-05-02T05:55:31+09:00 Subject: Re: assert_equal ([:r, :u, :b, :e, :q, :u, :e] __), [:b, :q] --0016e6d77c4a6a53e304beffca61 Content-Type: text/plain; charset=ISO-8859-1 You are welcome :) On Tue, May 1, 2012 at 4:33 PM, David Gustafson wrote: > Just the kind of pointer I was hoping for. Thanks. > > On Tue, May 1, 2012 at 12:12 PM, Raju Gandhi > wrote: > > 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 < > daveg@radicalskeptic.net> > > 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 > >> > > > > > > -- > Doubt is not a pleasant condition, but certainty is absurd. > -- Voltaire > > --0016e6d77c4a6a53e304beffca61 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You are welcome :)

On Tue, May 1, 2012 at= 4:33 PM, David Gustafson <daveg@radicalskeptic.net> = wrote:
Just the kind of pointer I was hoping for. = =A0Thanks.

On Tue, May 1, 2012 at 12:12 PM, Raju Gandhi <raju.gandhi@gmail.com> wrote:
> Hey David,
>
> Perhaps it has to do with certain operations that you can do with arra= ys 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 "Davi= d") and looks
> for a method called name=3D (Note there is no whitespace between name = and
> "=3D").
>
> I bring this up b/c it seems that you are thinking of a method that yo= u
> could use here ("I don't understand the above because the bla= nk 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 <daveg@radicalskeptic.net>
> wrote:
>>
>> This is part of a online ruby quiz. =A0Just 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. =A0I'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<= br> >> appreciated.
>>
>> --
>> Doubt is not a pleasant condition, but certainty is absurd.
>> =A0 =A0 =A0 =A0 -- Voltaire
>>
>



--
Doubt is not a pleasant condition, but certainty is absurd.
=A0 =A0 =A0 =A0 -- Voltaire


--0016e6d77c4a6a53e304beffca61--