[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Everything in ruby is an object?

Mark Gargan

6/22/2007 7:58:00 AM

Hey folks,


I'm reading the tutorial on Ruby located at

http://www.rubycentral...

In it the guys state that everything in Ruby is an object.
I was just wondering if that applies to Boolean expressions
i.e. the likes of && and ||. Is there a wrapper object for these
types? I've written a small expression filter that retrieves a boolean
expression from the db and I was just wondering if there was a quicker
way of processing it other than a case statement.

Thanks,
Mark.

--
Posted via http://www.ruby-....

15 Answers

Jano Svitok

6/22/2007 8:57:00 AM

0

On 6/22/07, Mark Gargan <mark.gargan@gmail.com> wrote:
> Hey folks,
>
>
> I'm reading the tutorial on Ruby located at
>
> http://www.rubycentral...
>
> In it the guys state that everything in Ruby is an object.
> I was just wondering if that applies to Boolean expressions
> i.e. the likes of && and ||. Is there a wrapper object for these
> types? I've written a small expression filter that retrieves a boolean
> expression from the db and I was just wondering if there was a quicker
> way of processing it other than a case statement.
>
> Thanks,
> Mark.

No. Expressions are not objects. Objects are true and false, and && ||
are methods.
Expressions are series of calls.

Robert Klemme

6/22/2007 9:01:00 AM

0

On 22.06.2007 09:57, Mark Gargan wrote:
> I'm reading the tutorial on Ruby located at
>
> http://www.rubycentral...
>
> In it the guys state that everything in Ruby is an object.
> I was just wondering if that applies to Boolean expressions
> i.e. the likes of && and ||. Is there a wrapper object for these
> types?

No expression in Ruby is an object. But results of evaluating them are
objects. There is no real boolean type in Ruby as the rule is "nil and
false are false, everything else is true".

> I've written a small expression filter that retrieves a boolean
> expression from the db and I was just wondering if there was a quicker
> way of processing it other than a case statement.

Not sure what you are at here. Can you show a short example of what you
are doing? (Not the DB retrieval but the postprocessing)

Kind regards

robert

gz zz

6/22/2007 9:16:00 AM

0

Jano Svitok wrote:
> On 6/22/07, Mark Gargan <mark.gargan@gmail.com> wrote:
>> types? I've written a small expression filter that retrieves a boolean
>> expression from the db and I was just wondering if there was a quicker
>> way of processing it other than a case statement.
>>
>> Thanks,
>> Mark.
>
> No. Expressions are not objects. Objects are true and false, and && ||
> are methods.
> Expressions are series of calls.

I think && is NOT method:
1.try:
class A
def &&
end
end

#parse error, unexpected tANDOP def && ^

2.& is a method,but && is not.because ruby eval method's arg

--
Posted via http://www.ruby-....

Mark Gargan

6/22/2007 9:42:00 AM

0

Thanks a million folks. That answers that I guess.
i'm not going to go about developing a class that will effectively just
mimic the case statement.

Would you guys know of any all in introduction to ruby on rails??

I've been working with JRuby for the past few weeks and would love to
see how
applicable it is to enterprise apps.

Thanks,
Mark.

--
Posted via http://www.ruby-....

Tim Hunter

6/22/2007 11:04:00 AM

0

Mark Gargan wrote:
> Thanks a million folks. That answers that I guess.
> i'm not going to go about developing a class that will effectively just
> mimic the case statement.
>
> Would you guys know of any all in introduction to ruby on rails??
>
> I've been working with JRuby for the past few weeks and would love to
> see how
> applicable it is to enterprise apps.
>

Rails? What's Rails?

Seriously, there's a whole web site devoted to RoR: www.rubyonrails.org.
Lots of suggestions about tutorials and books there. Also there's a
whole newsgroup devoted to Rails: http://www.ruby-forum.c....
It's full of people who like to talk about Rails stuff.

--
RMagick OS X Installer [http://rubyforge.org/project...]
RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?for...]
RMagick Installation FAQ [http://rmagick.rubyforge.org/instal...]


cornholio

1/19/2010 9:13:00 PM

0

On Jan 18, 9:56 pm, DoD <danskisan...@gmail.com> wrote:
> On Jan 18, 5:03 pm, Aviroce <dudaras...@gmail.com> wrote:
>
> > More options Jan 18, 10:33 am
>
> > Newsgroups: alt.politics, soc.culture.usa, soc.culture.lebanon,
> > soc.culture.israel, soc.culture.palestine
> > From: "tdny" <t...@live.com>
> > Date: Mon, 18 Jan 2010 13:33:53 -0500
> > Local: Mon, Jan 18 2010 10:33 am
> > Subject: Re: HOW COULD THE CATHOLIC CHURCH RECOGNIZE SOME KIND OF
> > MASS
> > MURDER WHEN THE ALLEGED VICTIMS THEMSELVES ARE MASS MURDERERS
>
> >http://www.youtube.com/watch?v=b...
>
> Do you know how ridiculous you make other Muslims look on a day to day
> basis?

All he's doing is saying what the rest of the muslime fucks are
thinking.

DoD

1/20/2010 4:04:00 AM

0

On Jan 19, 3:12 pm, cornholio <andxor...@gmail.com> wrote:
> On Jan 18, 9:56 pm, DoD <danskisan...@gmail.com> wrote:
>
>
>
>
>
> > On Jan 18, 5:03 pm, Aviroce <dudaras...@gmail.com> wrote:
>
> > > More options Jan 18, 10:33 am
>
> > > Newsgroups: alt.politics, soc.culture.usa, soc.culture.lebanon,
> > > soc.culture.israel, soc.culture.palestine
> > > From: "tdny" <t...@live.com>
> > > Date: Mon, 18 Jan 2010 13:33:53 -0500
> > > Local: Mon, Jan 18 2010 10:33 am
> > > Subject: Re: HOW COULD THE CATHOLIC CHURCH RECOGNIZE SOME KIND OF
> > > MASS
> > > MURDER WHEN THE ALLEGED VICTIMS THEMSELVES ARE MASS MURDERERS
>
> > >http://www.youtube.com/watch?v=b...
>
> > Do you know how ridiculous you make other Muslims look on a day to day
> > basis?
>
> All he's doing is saying what the rest of the muslime fucks are
> thinking.-

You are right.....It will be a good day for the west when this
scrounge gets his
ass kicked back to whatever backwater spawned the loser.

Aviroce

1/20/2010 4:13:00 AM

0

YOU PROBABLY DID NOT READ MY TITLE ABOUT JEWS CRYING "ANTI-SEMITISM"
LIKE SCREECHING HYENAS. I LEARNED THESE FACTS FROM THE INTERNET WHERE
PEOPLE SPEAK WITHOUT FEAR OR RETALIATION EXPRESSING THEIR FREEDOM OF
SPEECH AND RESEARCH.





On Jan 19, 8:04 pm, DoD <danskisan...@gmail.com> wrote:
> On Jan 19, 3:12 pm, cornholio <andxor...@gmail.com> wrote:
>
>
>
>
>
> > On Jan 18, 9:56 pm, DoD <danskisan...@gmail.com> wrote:
>
> > > On Jan 18, 5:03 pm, Aviroce <dudaras...@gmail.com> wrote:
>
> > > > More options Jan 18, 10:33 am
>
> > > > Newsgroups: alt.politics, soc.culture.usa, soc.culture.lebanon,
> > > > soc.culture.israel, soc.culture.palestine
> > > > From: "tdny" <t...@live.com>
> > > > Date: Mon, 18 Jan 2010 13:33:53 -0500
> > > > Local: Mon, Jan 18 2010 10:33 am
> > > > Subject: Re: HOW COULD THE CATHOLIC CHURCH RECOGNIZE SOME KIND OF
> > > > MASS
> > > > MURDER WHEN THE ALLEGED VICTIMS THEMSELVES ARE MASS MURDERERS
>
> > > >http://www.youtube.com/watch?v=b...
>
> > > Do you know how ridiculous you make other Muslims look on a day to day
> > > basis?
>
> > All he's doing is saying what the rest of the muslime fucks are
> > thinking.-
>
> You are right.....It will be a good day for the west when this
> scrounge gets his
> ass kicked back to whatever backwater spawned the loser.- Hide quoted text -
>
> - Show quoted text -

DoD

1/20/2010 5:31:00 AM

0

On Jan 19, 10:12 pm, Aviroce <dudaras...@gmail.com> wrote:
> YOU PROBABLY DID NOT READ MY TITLE ABOUT JEWS CRYING "ANTI-SEMITISM"
> LIKE SCREECHING HYENAS.  I LEARNED THESE FACTS FROM THE INTERNET WHERE
> PEOPLE SPEAK WITHOUT FEAR OR RETALIATION EXPRESSING THEIR FREEDOM OF
> SPEECH AND RESEARCH.

Like I said, it will be a good day for the west when you get your
assed kicked back to whatever scroungy place
you came from where you neighbor can sniff your ass five times a day,
hitler in a headscarf... Take you and that
filthy nightshirt and just go away.

RabbiJoekerr

1/21/2010 2:58:00 AM

0

On Jan 19, 10:43 pm, Aviroce <dudaras...@gmail.com> wrote:
> In my syllabi, I advised my cadets (military scollege)


BWAHAHAHAHR an illiterate fool like you could never have been an
instructor in a military college !!!



not to use
> terms on secretions and excretions in class.

And yet you do so all the time- hypocrite!!!




You guys keep using such vocabulary
> systematically thinking it will dehumanize posters,


Oh poor stupid hypocrite!!! You're the worst offender of such
conduct!!!





s.  You should realize that what you have been doing
> has determined who you are and what you stand for.



Yes this is why no one respects you- your conduct proves you're pure
garbage!