Sha256: 644deba12b14d3dbd06e75e4c423d919fd5b2dc84a13aedb9c02c2b1df2f6c4f
Contents?: true
Size: 542 Bytes
Versions: 9
Compression:
Stored size: 542 Bytes
Contents
module Remarkable # :nodoc: module CoreExt module Array # Extracts options from a set of arguments. Removes and returns the last # element in the array if it's a hash, otherwise returns a blank hash. # # def options(*args) # args.extract_options! # end # # options(1, 2) # => {} # options(1, 2, :a => :b) # => {:a=>:b} def extract_options! last.is_a?(::Hash) ? pop : {} end end end end Array.send :include, Remarkable::CoreExt::Array
Version data entries
9 entries across 9 versions & 1 rubygems