Method: Map::Options.for
- Defined in:
- lib/ima/options.rb
.for(arg) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ima/options.rb', line 5 def for(arg) = case arg when Hash arg when Array parse(arg) when String, Symbol {arg => true} else raise(ArgumentError, arg.inspect) unless arg.respond_to?(:to_hash) arg.to_hash end unless .is_a?(Options) = Map.for() .extend(Options) end raise unless .is_a?(Map) end |