我正在阅读
jbuilder’s README并看到这些代码:
class Person # ... Class Definition ... # def to_builder Jbuilder.new do |person| person.(self,:name,:age) end end end
class Thing attr_accessor :name,:age def call(*args) puts args.inspect end end Thing.new.(:name,:age) # => [:name,:age]
那么为什么jbuilder中会出现一个自我?