Sha256: dd72870ce02645c6e24e51566e589db7bc3007cfc1aa14291996ccc73ad91268

Contents?: true

Size: 253 Bytes

Versions: 14

Compression:

Stored size: 253 Bytes

Contents

class 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 extract_options!
    if last.is_a?(Hash)
      pop
    else
      {}
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
motion-support-1.2.1 motion/core_ext/array/extract_options.rb
motion-support-1.1.1 motion/core_ext/array/extract_options.rb
motion-support-1.2.0 motion/core_ext/array/extract_options.rb
motion-support-1.1.0 motion/core_ext/array/extract_options.rb
motion-support-1.0.0 motion/core_ext/array/extract_options.rb
motion-support-0.3.0 motion/core_ext/array/extract_options.rb
motion_blender-support-0.2.8 motion/core_ext/array/extract_options.rb
motion_blender-support-0.2.7 motion/core_ext/array/extract_options.rb
motion-support-0.2.6 motion/core_ext/array/extract_options.rb
motion-support-0.2.5 motion/core_ext/array/extract_options.rb
motion-support-0.2.4 motion/core_ext/array/extract_options.rb
motion-support-0.2.3 motion/core_ext/array/extract_options.rb
motion-support-0.2.2 motion/core_ext/array/extract_options.rb
motion-support-0.2.0 motion/core_ext/array/extract_options.rb