Sha256: c270a956bc7e5a394e1bc4f4442d15682d4f5e9d7538a600006bb8c33379a4c1
Contents?: true
Size: 1.08 KB
Versions: 71
Compression:
Stored size: 1.08 KB
Contents
= New Features * The convert! and convert_each! methods in the typecast_params plugin now support a :raise option for handling missing parameters specified as arguments to the methods. If the :raise option is set to false for convert! and the parameter argument is missing, then no conversion is done and an empty hash is returned: typecast_params.convert!('missing', raise: false) do |tp| # ... end # => {} If the :raise option is set to false for convert_each! and a :keys option is given, any key not present is ignored and nil will be returned for the converted value typecast_params.convert_each!(:keys=>['present', 'missing'], raise: false) do |tp| tp.int('b') end # => [{'b'=>1}, nil] = Other Improvements * The :symbolize setting to the convert! and convert_each! methods in the typecast_params plugin is no longer persisted beyond the call to the method. This fixes unexpected behavior if you do: typecast_params.convert!(:symbolize=>true) do |tp| # ... end typecast_params.convert! do |tp| # ... end
Version data entries
71 entries across 71 versions & 1 rubygems