class method self.new

Ruby on Rails 7.2.3.2

Since v7.2.3.2

Available in: v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

new(&secret_generator)

Initializes a new instance. secret_generator must accept a salt, and return a suitable secret (string). secret_generator may also accept arbitrary kwargs. If #rotate is called with any options matching those kwargs, those options will be passed to secret_generator instead of to the message verifier.

verifiers = ActiveSupport::MessageVerifiers.new do |salt, base:|
  MySecretGenerator.new(base).generate(salt)
end

verifiers.rotate(base: "...")
Source
# File activesupport/lib/active_support/message_verifiers.rb, line 31
    

Defined in activesupport/lib/active_support/message_verifiers.rb line 31 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::MessageVerifiers

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close