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 }
endUsage
Tokenized attributes
class Object
tokenized_attributes :attrb1, :attrb2
endOverride tokenizer proc
class Object
tokenized_attributes :attrb1, :attrb2, proc { SecureRandom.uuid }
endReset Attrb
object = Object.new
object.reset_tokenization_for_attrbLicense
The gem is available as open source under the terms of the MIT License.