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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:53:15+00:00 2026-06-14T19:53:15+00:00

In the process of developing my own library, I’ve been reading various Ruby libraries

  • 0

In the process of developing my own library, I’ve been reading various Ruby libraries on Github for understanding common idioms. One library I’ve been referencing (found here), leverages what I’d call an “unattached send method”. Here’s the code:

module AngellistApi
    class API

        attr_accessor *Configuration::VALID_OPTIONS_KEYS

        # Creates a new API
        def initialize(options={})
          options = AngellistApi.options.merge(options)
          Configuration::VALID_OPTIONS_KEYS.each do |key|
            send("#{key}=", options[key])
          end 
        end
    end  
end 

All documentation I can find online regarding the send method in Ruby, describes it as a way of calling a method of an object via a string or symbol. However all examples have the send method attache to the object, e.g.:

object.send(:method_name, argument1)

What happens when it isn’t attached to an object? In this case is it calling the methods for the class that it’s called within? Can someone explain this code for me? 🙂

  • 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-14T19:53:16+00:00Added an answer on June 14, 2026 at 7:53 pm

    As it occurs inside an instance method, the implied object here is self.

    # create a new object, assigning "foo = bar" given that
    # foo is in VALID_OPTIONS_KEYS
    object = AngellistApi::API.new({:foo => 'bar'})
    
    # this would essentially do the same thing again
    object.send("foo=", "bar")
    
    # (which is equivalent to)
    object.foo = bar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently in the process of developing my own little threading library, mainly for
I'm currently in the process of developing a fairly large static library which will
I’m currently in the process of developing my own blogging system. Currently when you
I'm in the process of developing an Android app. I have been able to
Im prepping for developing one project and am in process of mapping out stuff
I am developing an application based on one library. I am facing problem related
Iv been developing a Magento site for a few months now, during this process
one of the programs I'm developing at work is reading the registry to figure
we are in process of developing google chrome extension, in which we need to
We are in process of developing an Java based CMS related to travelling domain

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.