# Where is the send() function?

**URL:** <https://www.ruby-forum.com/t/where-is-the-send-function/53321>\
**Category:** Rails\
**Created:** [February 1, 2006, 6:33pm UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321 "2006-02-01T18:33:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vlad\_Berditchevskiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6de8d8/32.png) [@Vlad\_Berditchevskiy](https://www.ruby-forum.com/u/Vlad_Berditchevskiy)\
**Post date:** [February 1, 2006, 6:33pm UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321/1 "2006-02-01T18:33:53Z")

</div>

Hi,

in the tutorial “4 Days on Rails” the following code fragment is used:

,----  
| \<% for column in Category.content\_columns %\>  
| \<%=h category.send(column.name) %\>  
| \<% end %\>  
`----

Apparently, the send() function returns the column value by name, but  
where does this function comes from? Unfortunately, neither the tutorial  
nor the API documentation tell it.

–  
\ / removed\_email\_address@domain.invalid  
/lad [http://www.hashbang.de](http://www.hashbang.de)

---

<div class="post-metadata">

**Author:** ![Vlad\_Berditchevskiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6de8d8/32.png) [@Vlad\_Berditchevskiy](https://www.ruby-forum.com/u/Vlad_Berditchevskiy)\
**Post date:** [February 1, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321/2 "2006-02-01T18:39:56Z")

</div>

[http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref\_c\_object.html#Object.send](http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.send)

---

<div class="post-metadata">

**Author:** ![Vlad\_Berditchevskiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6de8d8/32.png) [@Vlad\_Berditchevskiy](https://www.ruby-forum.com/u/Vlad_Berditchevskiy)\
**Post date:** [February 1, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321/3 "2006-02-01T19:25:24Z")

</div>

On Feb 1, 2006, at 9:37 AM, Gael P. wrote:

> > Apparently, the send() function returns the column value by name, but  
> > where does this function comes from? Unfortunately, neither the  
> > tutorial  
> > nor the API documentation tell it.
> 
> [Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/html/)  
> ref\_c\_object.html#Object.send

No need to search the web:

## $ ri send ------------------------------------------------------------ Object#send obj.send(symbol [, args…]) =\> obj obj. **send** (symbol [, args…]) =\> obj

```
  Invokes the method identified by _symbol_, passing it any

```

arguments  
specified. You can use + **send** + if the name +send+ clashes with  
an existing method in _obj_.

```
     class Klass
       def hello(*args)
         "Hello " + args.join(' ')
       end
     end
     k = Klass.new
     k.send :hello, "gentle", "readers" #=> "Hello gentle readers"

```

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![Vlad\_Berditchevskiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6de8d8/32.png) [@Vlad\_Berditchevskiy](https://www.ruby-forum.com/u/Vlad_Berditchevskiy)\
**Post date:** [February 2, 2006, 4:57am UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321/4 "2006-02-02T04:57:50Z")

</div>

Vlad Berditchevskiy wrote:

> Hi,
> 
> in the tutorial “4 Days on Rails” the following code fragment is used:
> 
> ,----  
> | \<% for column in Category.content\_columns %\>  
> | \<%=h category.send(column.name) %\>  
> | \<% end %\>  
> `----
> 
> Apparently, the send() function returns the column value by name, but  
> where does this function comes from? Unfortunately, neither the tutorial  
> nor the API documentation tell it.
> 
> –  
> \ / removed\_email\_address@domain.invalid  
> /lad [http://www.hashbang.de](http://www.hashbang.de)

Consider this:

-1.send(“abs”)

---

<div class="post-metadata">

**Author:** ![Vlad\_Berditchevskiy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/6de8d8/32.png) [@Vlad\_Berditchevskiy](https://www.ruby-forum.com/u/Vlad_Berditchevskiy)\
**Post date:** [February 2, 2006, 4:37am UTC](https://www.ruby-forum.com/t/where-is-the-send-function/53321/5 "2006-02-02T04:37:50Z")

</div>

send and **send** are methods on the Object class in Ruby.

“Invokes the method identified by symbol, passing it any arguments and  
block.”

Bob S.  
[http://www.railtie.net/](http://www.railtie.net/)
