Variables in ruby method names

前端 未结 4 1024
感情败类
感情败类 2021-01-30 00:50

I have the following code:

for attribute in site.device_attributes
  device.attribute
end

where I would like the code to substitute the value o

4条回答
  •  臣服心动
    2021-01-30 01:34

    Matt and Maxim are both correct, but leave out a detail that might help you get your head around the #send syntax: In Ruby, calling a method is really sending a message. Softies on Rails has a relatively straightforward explanation of that.

提交回复
热议问题