Module: TTY::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/tty/support/utils.rb

Instance Method Summary collapse

Instance Method Details

#extract_options(args) ⇒ Object



11
12
13
14
# File 'lib/tty/support/utils.rb', line 11

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

#extract_options!(args) ⇒ Object



7
8
9
# File 'lib/tty/support/utils.rb', line 7

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