Simple masked string wrapper class. Once instantiated, the unmasked value cannot be accessed. Normal methods like ==
, +
, and to_s
are handled as well.
- Add the dependency to your
shard.yml
:
dependencies:
masked_string:
github: denolfe/masked-string
- Run
shards install
require "masked_string"
masked = Masked::Str.new("123456789", 4)
masked.value #=> "*****6789"
masked.to_s #=> "*****6789"
- Fork it (https://github.com/denolfe/masked_string/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Elliot DeNolf - creator and maintainer