Last Updated: February 25, 2016
·
759
· _ismaelga

Where to use new literal %i on Ruby 2.0.0

A nice place to use this new thing is on attr_accessor and others alike. Here is an example

class A
  attr_accessor *%i(foo bar)
end
a = A.new
a.foo = 1
a.foo #=> 1