Module: Hg::Utils

Defined in:
lib/hg/utils.rb

Class Method Summary collapse

Class Method Details

.extract_options(args) ⇒ Object

Extract options hash from an array argument.

Parameters:

  • args (Array[Object])


10
11
12
13
# File 'lib/hg/utils.rb', line 10

def extract_options(args)
  options = args.last
  options.respond_to?(:to_hash) ? options.to_hash.dup : {}
end

.extract_options!(args) ⇒ Object



15
16
17
# File 'lib/hg/utils.rb', line 15

def extract_options!(args)
  args.last.respond_to?(:to_hash) ? args.pop : {}
end