Commit dcfcb2f3 by liyijie

fix: try_chain try m.to_sym

parent b71d8bd6
...@@ -244,7 +244,7 @@ module TalltyImportExport ...@@ -244,7 +244,7 @@ module TalltyImportExport
index = m.to_i index = m.to_i
r[index] if r.is_a?(Array) || (r.respond_to?(:[]) && index < r.size) # If r is an Array or responds to :[] r[index] if r.is_a?(Array) || (r.respond_to?(:[]) && index < r.size) # If r is an Array or responds to :[]
else else
r.try(m) || r.try(:[], m) r.try(m) || r.try(:[], m) || r.try(:[], m.to_sym)
end end
rescue StandardError rescue StandardError
nil nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment