Module: Tins::ExtractLastArgumentOptions

Defined in:
lib/tins/extract_last_argument_options.rb

Instance Method Summary collapse

Instance Method Details

#extract_last_argument_optionsObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/tins/extract_last_argument_options.rb', line 3

def extract_last_argument_options
  last_argument = last
  if last_argument.respond_to?(:to_hash) and
    options = last_argument.to_hash.dup
  then
    return self[0..-2], options
  else
    return dup, {}
  end
end