Sha256: c9d19522d99a94086fdb74864fac1b344c1f1d11d5f65d7544829443f3eb776f
Contents?: true
Size: 392 Bytes
Versions: 13
Compression:
Stored size: 392 Bytes
Contents
module ArgsParser class Filter def filters @filters ||= [] end def add(name, filter) name = name.to_sym if name filters.push({:name => name, :filter => filter}) end def filter(name, value) filters.each do |f| if !f[:name] or f[:name] == name value = f[:filter].call(value) end end value end end end
Version data entries
13 entries across 13 versions & 1 rubygems