We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30327ee commit 252ff50Copy full SHA for 252ff50
lib/ostruct.rb
@@ -202,7 +202,7 @@ def method_missing(mid, *args) # :nodoc:
202
if len != 1
203
raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
204
end
205
- modifiable?[new_ostruct_member!(mname)] = args[0]
+ modifiable?[new_ostruct_member!(mname)] = args[0].is_a?(Hash) ? OpenStruct.new(args[0]) : args[0]
206
elsif len == 0 # and /\A[a-z_]\w*\z/ =~ mid #
207
if @table.key?(mid)
208
new_ostruct_member!(mid) unless frozen?
0 commit comments