Releases: jessedoyle/shrink_wrap
Releases · jessedoyle/shrink_wrap
1.0.2
- Fix an issue with the
shrink_wrap
require statement. #8 , Thanks @mvandenbeuken!
1.0.1
Previously the default callable option on a property translation would not correctly resolve a value when the input hash value was nil
. This release fixes the default property resolution logic when values are explicitly nil
.
i.e.
class MyClass
include Shrink::Wrap
transform(Shrink::Wrap::Transformer::Symbolize)
translate(
name: { from: :name, allow_nil: false, default: -> { 'jane' } }
)
end
instance = MyClass.shrink_wrap(name: nil)
# previous behaviour
instance.name # => nil
# fixed behaviour
instance.name # => "jane"
1.0.0
- Explicity require
stringio
from the standard library as it is used for some error messages.
0.2.0
- breaking change: Modify the
CollectionFromKey
transformer to map non-hash values into a hash with avalue
property.
i.e.
input = { names: { john: 'foo', jane: 'bar' } }
transformer.transform(input) #=> { names: [{ name: :john, value: 'foo' }, { name: :jane, value: 'bar' }] }
0.1.1
-
Previously a coercion that was defined as follows:
coerce( boolean: ->(v) { v.to_s.casecmp('true').zero? } )
would incorrectly return the string
'false'
when given an input
string of'false'
. This was due to short-circuit evaluation. -
Fix the bug by using an explicit
if/else
block. -
Relax the restriction on bundler in the dev environment - there's
no need to require a specific version. -
Bump version to 0.1.1.
-
Setup Github Actions for CI.
0.1.0
- Initial Release!