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 7659843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:23:10+00:00 2026-05-31T13:23:10+00:00

I am doing some metaprogramming in ruby and in the method_missing implementation I wonder

  • 0

I am doing some metaprogramming in ruby and in the method_missing implementation I wonder If i can tell if the call site is being used in an assignment ?

For example :

x = special_function 'param'

would be caught by the method_missing implementation. I would like to know if I can tell if the function was invoked like this :

special_function 'param'

I.e. without a left hand side on the assignment.

Is it possible in ruby to tell the difference between the above two examples in code ?

  • 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-05-31T13:23:11+00:00Added an answer on May 31, 2026 at 1:23 pm

    I wouldn’t think this is possible, simply because every method always returns something and evaluating a method is independent of the context in which it is called.

    The assignment is incidental in this case and just happens to make use of what the method returns.

    Is there a reason you want to distinguish these calls? Maybe there are other ways to look at the same problem by following a naming convention in your methods to help you separate their uses.

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

Sidebar

Related Questions

I'm doing some metaprogramming in Ruby, and I need to dynamically generate a sibling
I am currently doing some template metaprogramming. In my case I can handle any
When doing metaprogramming using C++ templates, is there a method that can be used,
After doing some work with Ruby, Rails, and RSpec last summer and I learned
Been doing some playing call my service which is on a different domain using
while doing some static code analysis I've found a weird one. On a call
Doing some archiving/deleting of some uncommonly used databases on an Oracle server. Has anyone
After doing some stuff in Ruby on Rails with Cucumber, RSpec and Ruby BDD
Doing some homework here (second assignment, still extremely green...). The object is to read
Doing some integration work with another site I've got the unusual requirement of needing

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.