There's a commonly used approach to extract options from method arguments using Array#extract_options!
Example:
Unable to find source-code formatter for language: ruby. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
require 'active_support' def foo(*args) args.extract_options! end foo(1, 1, { :some => 'hash' }) # => { :some => 'hash' }
However when using `bson` gem inside a project the example above returns {}.
ActiveSupport requires BSON::OrderedHash to implement method #extractable_options? to support options extraction. See https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/array/extract_options.rb#L7
Expected result: It should still be possible to use Array#extract_options! if a gem has dependency on `bson`