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

  • Home
  • SEARCH
  • 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 8790909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:46:12+00:00 2026-06-13T22:46:12+00:00

If I do the following, for example: foo = [bar] foo.keep_if {|n| foo.last.obect_id ==

  • 0

If I do the following, for example:

foo = ["bar"]
foo.keep_if {|n| foo.last.obect_id == n.object_id}

Is there another way I can refer to foo inside the block instead of naming it, something like “n.container”?

  • 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-13T22:46:13+00:00Added an answer on June 13, 2026 at 10:46 pm

    No, there isn’t. An object can appear in any number of containers (and there is no protocol for containers to tell objects, “Yo, I’mma contain you now”), so it isn’t really practical. Just using the existing variable in your block is the cleanest way to do it.

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

Sidebar

Related Questions

Inside a visual studio project I have the following folders (for example) foo/ bar/
This is just an example, but given the following model: class Foo(models.model): bar =
Please consider the following example struct Foo { int bar; Foo(int i):bar(i){cout << real
Consider the following example code: class Foo { }; class Bar : public Foo
Take the following example, preg_match_all(/(^|-)[a-z]+(-|$)/i, foo-bar-moo, $matches); This (correctly) returns the following matches, foo-
Anyone can help with this? Imagine the following: def example(s): s = s.replace('foo', 'foo
Consider the following example class Foo{ public: Foo(int i):x(i){} int x; }; void bar(Foo
Is the following example appropriate for PHP's require_once construct? function foo( $param ) {
I find the following example mildly surprising: >>> class Foo: def blah(self): pass >>>
Consider the following class: class Foo { enum Flags {Bar, Baz, Bax}; template<Flags, class

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.