Ruby Issue Tracking System: Issueshttps://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112016-03-02T11:19:25ZRuby Issue Tracking System
Redmine Ruby master - Bug #12136 (Closed): OpenStruct.new(format: :bar).send :format # => too few argumentshttps://redmine.ruby-lang.org/issues/121362016-03-02T11:19:25Zniko (Niko Dittmann)
<p>#send(:format) to an OpenStruct with a field named :format raises an ArgumentError in Ruby 2.3.0:</p>
<pre><code>OpenStruct.new(format: :bar).send :format
ArgumentError: too few arguments
</code></pre>
<p>It works as expected in ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] and with any other method name I tried:</p>
<pre><code>OpenStruct.new(f: :bar).send :f
=> :bar
</code></pre>
<p>String or Symbol in the OpenStruct definition and as argument of #send make no difference.</p>