Method: Map::Options#get_opt

Defined in:
lib/ima/options.rb

#get_opt(opts, options = {}) ⇒ Object Also known as: getopt



67
68
69
70
71
72
73
74
# File 'lib/ima/options.rb', line 67

def get_opt(opts, options = {})
  options = Map.for(options.is_a?(Hash) ? options : {:default => options})
  default = options[:default]
  [ opts ].flatten.each do |opt|
    return fetch(opt) if has_key?(opt)
  end
  default
end