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, = {}) = Map.for(.is_a?(Hash) ? : {:default => }) default = [:default] [ opts ].flatten.each do |opt| return fetch(opt) if has_key?(opt) end default end |