module Nuggets::Array::ExtractOptionsMixin

Public Instance Methods

extract_options([default]) → aHash or +default+ click to toggle source

Returns options hash from array or default.

# File lib/nuggets/array/extract_options_mixin.rb, line 35
def extract_options(default = {})
  last.is_a?(::Hash) ? last : default
end
extract_options!([default]) → aHash or +default+ click to toggle source

Extracts options hash from array or returns default.

# File lib/nuggets/array/extract_options_mixin.rb, line 43
def extract_options!(default = {})
  last.is_a?(::Hash) ? pop : default
end