class

ActionMailer::Preview

Inherits Reference < Object

End-of-program codegen: for every mailer class, each public instance method (the "actions") gets a class-level twin returning a lazy MessageDelivery — the analog of Rails' class-level method_missing — plus a serialized-args dispatcher (__deliver) used by MailDeliveryJob, and a name lookup (ActionMailer.lookup_mailer).

Constructors

new(params : Hash(String, ActiveJob::ArgValue) = {} of String => ActiveJob::ArgValue)
Source

Class methods

call(email : String, params : Hash(String, ActiveJob::ArgValue) = {} of String => ActiveJob::ArgValue)

Builds the preview instance with params and calls the email method (Rails: new(params).public_send(email)).

Source
email_exists?(email : String) : Bool
Source
emails

Overridden per subclass by end-of-program codegen (base.cr): the compile-time-known public email methods.

Source
exists?(preview_name : String) : Bool
Source
find(preview_name : String) : ::ActionMailer::Preview.class | Nil
Source
preview_name

"UserMailerPreview" → "user_mailer" (underscored, no suffix). Runtime to_s (the class name) so it stays correct through virtual dispatch from Preview.all.

Source

Instance methods

email(method_name : String)

String-dispatch twin of Ruby's public_send — replaced per subclass by a case ladder over the compile-time-known methods.

Source
params
Source