Sha256: d745bf699fa69820ba2f58c2b9cfd9ddbdd18cf6292c8dc478e4efff627a6fe1
Contents?: true
Size: 561 Bytes
Versions: 20
Compression:
Stored size: 561 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
20 entries across 20 versions & 1 rubygems