Method: #last_arg

Defined in:
lib/sugar-high/arguments.rb

#last_arg(default, *args) ⇒ Object



44
45
46
47
# File 'lib/sugar-high/arguments.rb', line 44

def last_arg default, *args
  last = args.flatten.last
  last.kind_of?(Hash) ? last : default
end