Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:27:46+00:00 2026-06-09T04:27:46+00:00

In the tutorial Rubymonk says : In Ruby, just like in real life, our

  • 0

In the tutorial Rubymonk says :

“In Ruby, just like in real life, our world is filled with objects. Everything is an object – integers, characters, text, arrays – everything.”

But && and || are operators, operators are objects too ? how check ?

this is not going against the philosophy of ruby “All is a object” ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:27:48+00:00Added an answer on June 9, 2026 at 4:27 am

    It depends on how you define “everything”. I personally would never claim that each individual concept in ruby is an object. I suppose there isn’t really a good definition to describe how ruby works. I think you just have to accept the way ruby does it, which will become plain as you use it.

    If you want to see if something is an object, try assigning it to a variable, or calling a method on it. You’ll get an error if you try to do that with an operator. A notable exception is methods, which aren’t objects but return objects.

    Note that the concept of an object is somewhat abstract. Two variables can point to the same object. Every object is represented by an object_id. You might think of an object_id like a location in memory. Or, you can think of an object as a house, and multiple address books can contain the house’s address.

    # point 2 variables to the same object
    >> s = t = 's'
    => "s"
    >> s.object_id
    => 70269794388360
    >> t.object_id
    => 70269794388360
    
    # get the object by id (for demonstration only; I don't recommend using this in application code)
    >> ObjectSpace._id2ref(70269794388360)
    => "s"
    
    # modifying the object. both variables "see" the change
    >> s << '_'
    => "s_"
    >> t
    => "s_"
    

    Continuing the house analogy, appending to a string via << is like bringing a new chair into the house. Everyone who follows their address book to that house (using the address) will see that the house (object) has the new chair.

    The ruby language designers did not see a reason to allow treating operators like && as objects. Can you see any reason to allow it?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a tutorial I've been following and I've done everything that it tells
I was following this tutorial , but for the life of me I cant
The tutorial says to use android.appwidget.action.APPWIDGET_UPDATE in the action element within the XML intent-filter
I am following the interactive tutorials on rubymonk.com and have just started with lambda's
Every tutorial that I've read so far says that package name should be in
Python tutorial says Use spaces around operators and after commas, but not directly inside
Every tutorial or explanation of REST just goes too complicated too quickly - the
I'm following this tutorial (seems good) for Rails. After I run ruby script/generate scaffold
The tutorial says: Define a function named callFunc that takes one argument, a function
Every tutorial I come across says to make sure you call jQuery in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.