class Array

def extract_options!

options(1, 2, a: :b) # => {:a=>:b}
options(1, 2) # => {}

end
args.extract_options!
def options(*args)

element in the array if it's a hash, otherwise returns a blank hash.
Extracts options from a set of arguments. Removes and returns the last
def extract_options!
  if last.is_a?(Hash) && last.extractable_options?
    pop
  else
    {}
  end
end