1 module ActiveSupport
#:nodoc:
2 module CoreExtensions
#:nodoc:
5 # Extracts options from a set of arguments. Removes and returns the last
6 # element in the array if it's a hash, otherwise returns a blank hash.
9 # args.extract_options!
12 # options(1, 2) # => {}
13 # options(1, 2, :a => :b) # => {:a=>:b}
15 last
.is_a
?(::Hash) ? pop
: {}