<p>I have the following code:</p>

<pre><code>for attribute in site.device_attributes
  device.attribute
end
</code></pre>

<p>where I would like the code to substitute the value of "attribute" for the method name.</p>

<p>I have tried <code>device."#{attribute}"</code> and various permutations.</p>

<p>Is this completely impossible? Am I missing something?</p>

<p>I have considered overriding method_missing, but I can't figure out how that would actually help me when my problem is that I need to call an "unknown" method.</p>

The "send" method should do what you're looking for:
```
```
object = "upcase me!"
method = "upcase"
object.send(method.to_sym) # => "UPCASE ME!"
```
```