Sha256: 27437e18870954b738acca23281f2c35ff94b6108d917b3fb7937fb782e8fbd4

Contents?: true

Size: 206 Bytes

Versions: 5

Compression:

Stored size: 206 Bytes

Contents

class Hash
  def extractable_options?
    instance_of?(Hash)
  end
end

class Array
  def extract_options!
    if last.is_a?(Hash) && last.extractable_options?
      pop
    else
      {}
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
happy_support-1.0.0 lib/happy_support/core_ext/array/extract_options.rb
em-fs-0.1.2 lib/em-fs/core_ext.rb
em-fs-0.1.1 lib/em-fs/core_ext.rb
em-fs-0.1.0 lib/em-fs/core_ext.rb
em-fs-0.0.1 lib/em-fs/core_ext.rb