TokenizeAttributes
TokenizeAttributes allows to define a tokenized attribute.
A before validation is generate on the attribute to set a tokenized value on the attribute
Installation
gem 'tokenize_attributes', '~> 0.1.1'
Configuration
TokenizeAttributes.configure do |config|
config.tokenizer = proc { SecureRandom.hex }
end
Usage
Tokenized attributes
class Object
tokenized_attributes :attrb1, :attrb2
end
Override tokenizer proc
class Object
tokenized_attributes :attrb1, :attrb2, proc { SecureRandom.uuid }
end
Reset Attrb
object = Object.new
object.reset_tokenization_for_attrb
License
The gem is available as open source under the terms of the MIT License.