From 550323e91547c48fb5ec7091c5575c432e9069bb Mon Sep 17 00:00:00 2001 From: jwoertink Date: Sun, 25 Feb 2024 20:18:40 +0000 Subject: [PATCH] deploy: 55d2838f1a87a82bc93d011065881dd87cdec96a --- Carbon.html | 8 +-- Carbon/Adapter.html | 4 +- Carbon/Address.html | 18 ++--- Carbon/AttachFile.html | 2 +- Carbon/AttachIO.html | 2 +- Carbon/Attachment.html | 2 +- Carbon/Callbacks.html | 10 +-- Carbon/DeliverLaterStrategy.html | 4 +- Carbon/DevAdapter.html | 12 ++-- Carbon/Email.html | 66 +++++++++---------- Carbon/Email/Recipients.html | 2 +- Carbon/EmailTemplate.html | 8 +-- Carbon/Emailable.html | 6 +- Carbon/Expectations.html | 4 +- .../Expectations/BeDeliveredExpectation.html | 12 ++-- .../HaveDeliveredEmailsExpectation.html | 8 +-- Carbon/ResourceFile.html | 2 +- Carbon/ResourceIO.html | 2 +- Carbon/SpawnStrategy.html | 4 +- Gen.html | 2 +- Gen/Email.html | 16 ++--- String.html | 4 +- index.json | 2 +- search-index.js | 2 +- 24 files changed, 101 insertions(+), 101 deletions(-) diff --git a/Carbon.html b/Carbon.html index 2142f19..0eab964 100644 --- a/Carbon.html +++ b/Carbon.html @@ -227,28 +227,28 @@

- + carbon.cr
- + carbon/attachment.cr
- + carbon/emailable.cr
- + carbon/version.cr diff --git a/Carbon/Adapter.html b/Carbon/Adapter.html index a622a8f..c2982de 100644 --- a/Carbon/Adapter.html +++ b/Carbon/Adapter.html @@ -243,7 +243,7 @@

- + carbon/adapter.cr @@ -336,7 +336,7 @@


- [View source] + [View source]
diff --git a/Carbon/Address.html b/Carbon/Address.html index 24e70de..b1d7c83 100644 --- a/Carbon/Address.html +++ b/Carbon/Address.html @@ -243,7 +243,7 @@

- + carbon/address.cr @@ -410,7 +410,7 @@


- [View source] + [View source]
@@ -426,7 +426,7 @@


- [View source] + [View source]
@@ -467,7 +467,7 @@


- [View source] + [View source]
@@ -483,7 +483,7 @@


- [View source] + [View source]
@@ -499,7 +499,7 @@


- [View source] + [View source]
@@ -515,7 +515,7 @@


- [View source] + [View source]
@@ -547,7 +547,7 @@


- [View source] + [View source]
@@ -576,7 +576,7 @@


- [View source] + [View source]
diff --git a/Carbon/AttachFile.html b/Carbon/AttachFile.html index 7026a57..dbf56a0 100644 --- a/Carbon/AttachFile.html +++ b/Carbon/AttachFile.html @@ -237,7 +237,7 @@

- + carbon/attachment.cr diff --git a/Carbon/AttachIO.html b/Carbon/AttachIO.html index 4b4982d..14ed202 100644 --- a/Carbon/AttachIO.html +++ b/Carbon/AttachIO.html @@ -237,7 +237,7 @@

- + carbon/attachment.cr diff --git a/Carbon/Attachment.html b/Carbon/Attachment.html index d1e6130..9140490 100644 --- a/Carbon/Attachment.html +++ b/Carbon/Attachment.html @@ -237,7 +237,7 @@

- + carbon/attachment.cr diff --git a/Carbon/Callbacks.html b/Carbon/Callbacks.html index 57aeaa4..20ba034 100644 --- a/Carbon/Callbacks.html +++ b/Carbon/Callbacks.html @@ -241,7 +241,7 @@

- + carbon/callbacks.cr @@ -340,7 +340,7 @@


- [View source] + [View source]
@@ -365,7 +365,7 @@


- [View source] + [View source]
@@ -391,7 +391,7 @@


- [View source] + [View source]
@@ -415,7 +415,7 @@


- [View source] + [View source]
diff --git a/Carbon/DeliverLaterStrategy.html b/Carbon/DeliverLaterStrategy.html index a41fc25..d6f4794 100644 --- a/Carbon/DeliverLaterStrategy.html +++ b/Carbon/DeliverLaterStrategy.html @@ -243,7 +243,7 @@

- + carbon/deliver_later_strategy.cr @@ -336,7 +336,7 @@


- [View source] + [View source]
diff --git a/Carbon/DevAdapter.html b/Carbon/DevAdapter.html index 38f101d..3ec2a49 100644 --- a/Carbon/DevAdapter.html +++ b/Carbon/DevAdapter.html @@ -229,7 +229,7 @@

- + carbon/adapters/dev_adapter.cr @@ -382,7 +382,7 @@


- [View source] + [View source]
@@ -410,7 +410,7 @@


- [View source] + [View source]
@@ -426,7 +426,7 @@


- [View source] + [View source]
@@ -442,7 +442,7 @@


- [View source] + [View source]
@@ -472,7 +472,7 @@


- [View source] + [View source]
diff --git a/Carbon/Email.html b/Carbon/Email.html index ae9f88d..f2ea7aa 100644 --- a/Carbon/Email.html +++ b/Carbon/Email.html @@ -243,7 +243,7 @@

- + carbon/email.cr @@ -345,7 +345,7 @@

  • - #attachments : Array({file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}) + #attachments
  • @@ -514,7 +514,7 @@


    - [View source] + [View source]
    @@ -530,7 +530,7 @@


    - [View source] + [View source]
    @@ -546,7 +546,7 @@


    - [View source] + [View source]
    @@ -562,7 +562,7 @@


    - [View source] + [View source]
    @@ -578,7 +578,7 @@


    - [View source] + [View source]
    @@ -594,7 +594,7 @@


    - [View source] + [View source]
    @@ -610,7 +610,7 @@


    - [View source] + [View source]
    @@ -626,7 +626,7 @@


    - [View source] + [View source]
    @@ -642,7 +642,7 @@


    - [View source] + [View source]
    @@ -658,7 +658,7 @@


    - [View source] + [View source]
    @@ -695,7 +695,7 @@


    - [View source] + [View source]
    @@ -711,23 +711,23 @@


    - [View source] + [View source]
    -
    +
    - def attachments : Array({file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}) + def attachments - # + #

    - [View source] + [View source]
    @@ -743,7 +743,7 @@


    - [View source] + [View source]

    @@ -759,7 +759,7 @@


    - [View source] + [View source]
    @@ -775,7 +775,7 @@


    - [View source] + [View source]
    @@ -791,7 +791,7 @@


    - [View source] + [View source]
    @@ -807,7 +807,7 @@


    - [View source] + [View source]
    @@ -829,7 +829,7 @@


    - [View source] + [View source]
    @@ -851,7 +851,7 @@


    - [View source] + [View source]
    @@ -867,7 +867,7 @@


    - [View source] + [View source]
    @@ -883,7 +883,7 @@


    - [View source] + [View source]
    @@ -899,7 +899,7 @@


    - [View source] + [View source]
    @@ -915,7 +915,7 @@


    - [View source] + [View source]
    @@ -931,7 +931,7 @@


    - [View source] + [View source]
    @@ -947,7 +947,7 @@


    - [View source] + [View source]
    @@ -963,7 +963,7 @@


    - [View source] + [View source]
    @@ -979,7 +979,7 @@


    - [View source] + [View source]
    diff --git a/Carbon/Email/Recipients.html b/Carbon/Email/Recipients.html index 9711bac..34a4dc5 100644 --- a/Carbon/Email/Recipients.html +++ b/Carbon/Email/Recipients.html @@ -237,7 +237,7 @@

    - + carbon/email.cr diff --git a/Carbon/EmailTemplate.html b/Carbon/EmailTemplate.html index 45ae765..068164d 100644 --- a/Carbon/EmailTemplate.html +++ b/Carbon/EmailTemplate.html @@ -229,7 +229,7 @@

    - + carbon/tasks/gen/email.cr @@ -338,7 +338,7 @@


    - [View source] + [View source]
    @@ -370,7 +370,7 @@


    - [View source] + [View source]
    @@ -386,7 +386,7 @@


    - [View source] + [View source]
    diff --git a/Carbon/Emailable.html b/Carbon/Emailable.html index d5ce4ea..b66e395 100644 --- a/Carbon/Emailable.html +++ b/Carbon/Emailable.html @@ -243,7 +243,7 @@

    - + carbon/emailable.cr @@ -324,7 +324,7 @@


    - [View source] + [View source]
    @@ -345,7 +345,7 @@


    - [View source] + [View source]
    diff --git a/Carbon/Expectations.html b/Carbon/Expectations.html index 245dc08..ac828fb 100644 --- a/Carbon/Expectations.html +++ b/Carbon/Expectations.html @@ -227,14 +227,14 @@

    - + carbon/expectations.cr
    - + carbon/expectations/be_delivered_expectation.cr diff --git a/Carbon/Expectations/BeDeliveredExpectation.html b/Carbon/Expectations/BeDeliveredExpectation.html index 5d2534d..a86e25e 100644 --- a/Carbon/Expectations/BeDeliveredExpectation.html +++ b/Carbon/Expectations/BeDeliveredExpectation.html @@ -229,7 +229,7 @@

    - + carbon/expectations/be_delivered_expectation.cr @@ -361,7 +361,7 @@


    - [View source] + [View source]
    @@ -393,7 +393,7 @@


    - [View source] + [View source]
    @@ -409,7 +409,7 @@


    - [View source] + [View source]
    @@ -425,7 +425,7 @@


    - [View source] + [View source]
    @@ -441,7 +441,7 @@


    - [View source] + [View source]
    diff --git a/Carbon/Expectations/HaveDeliveredEmailsExpectation.html b/Carbon/Expectations/HaveDeliveredEmailsExpectation.html index 7581ea2..d5b088a 100644 --- a/Carbon/Expectations/HaveDeliveredEmailsExpectation.html +++ b/Carbon/Expectations/HaveDeliveredEmailsExpectation.html @@ -229,7 +229,7 @@

    - + carbon/expectations/have_delivered_emails_expectation.cr @@ -332,7 +332,7 @@


    - [View source] + [View source]
    @@ -348,7 +348,7 @@


    - [View source] + [View source]
    @@ -364,7 +364,7 @@


    - [View source] + [View source]
    diff --git a/Carbon/ResourceFile.html b/Carbon/ResourceFile.html index 2f306cb..fe50ccc 100644 --- a/Carbon/ResourceFile.html +++ b/Carbon/ResourceFile.html @@ -237,7 +237,7 @@

    - + carbon/attachment.cr diff --git a/Carbon/ResourceIO.html b/Carbon/ResourceIO.html index bdb83fe..fed6fd8 100644 --- a/Carbon/ResourceIO.html +++ b/Carbon/ResourceIO.html @@ -237,7 +237,7 @@

    - + carbon/attachment.cr diff --git a/Carbon/SpawnStrategy.html b/Carbon/SpawnStrategy.html index 5603df0..1334b63 100644 --- a/Carbon/SpawnStrategy.html +++ b/Carbon/SpawnStrategy.html @@ -229,7 +229,7 @@

    - + carbon/spawn_strategy.cr @@ -344,7 +344,7 @@


    - [View source] + [View source]
    diff --git a/Gen.html b/Gen.html index e5e5857..81ab663 100644 --- a/Gen.html +++ b/Gen.html @@ -227,7 +227,7 @@

    - + carbon/tasks/gen/email.cr diff --git a/Gen/Email.html b/Gen/Email.html index b08d65b..43406d7 100644 --- a/Gen/Email.html +++ b/Gen/Email.html @@ -243,7 +243,7 @@

    - + carbon/tasks/gen/email.cr @@ -477,7 +477,7 @@


    - [View source] + [View source]
    @@ -499,7 +499,7 @@


    - [View source] + [View source]
    @@ -529,7 +529,7 @@


    - [View source] + [View source]
    @@ -545,7 +545,7 @@


    - [View source] + [View source]
    @@ -561,7 +561,7 @@


    - [View source] + [View source]
    @@ -633,7 +633,7 @@


    - [View source] + [View source]
    @@ -649,7 +649,7 @@


    - [View source] + [View source]
    diff --git a/String.html b/String.html index c9c7555..f3d5700 100644 --- a/String.html +++ b/String.html @@ -345,7 +345,7 @@

    - + carbon/string_extensions.cr @@ -478,7 +478,7 @@


    - [View source] + [View source]
    diff --git a/index.json b/index.json index c80fb37..208adba 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -{"repository_name":"carbon","body":"# Carbon\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Fcarbon%2F)](https://luckyframework.github.io/carbon)\n\nEmail library written in Crystal.\n\n![code preview](https://user-images.githubusercontent.com/22394/38457909-9f16f9fe-3a64-11e8-852c-74e31238f48b.png)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n carbon:\n github: luckyframework/carbon\n```\n\n## Adapters\n\n- `Carbon::SendGridAdapter`- See [luckyframework/carbon_sendgrid_adapter](https://github.com/luckyframework/carbon_sendgrid_adapter).\n- `Carbon::SmtpAdapter` - See [luckyframework/carbon_smtp_adapter](https://github.com/luckyframework/carbon_smtp_adapter).\n- `Carbon::AwsSesAdapter` - See [keizo3/carbon_aws_ses_adapter](https://github.com/keizo3/carbon_aws_ses_adapter).\n- `Carbon::SendInBlueAdapter` - See [atnos/carbon_send_in_blue_adapter](https://github.com/atnos/carbon_send_in_blue_adapter).\n- `Carbon::MailgunAdapter` - See [atnos/carbon_mailgun_adapter](https://github.com/atnos/carbon_mailgun_adapter).\n- `Carbon::SparkPostAdapter` - See [Swiss-Crystal/carbon_sparkpost_adapter](https://github.com/Swiss-Crystal/carbon_sparkpost_adapter).\n- `Carbon::PostmarkAdapter` - See [makisu/carbon_postmark_adapter](https://github.com/makisu/carbon_postmark_adapter).\n- `Carbon::MailersendAdapter` - See [balakhorvathnorbert/carbon_mailersend_adapter](https://github.com/balakhorvathnorbert/carbon_mailersend_adapter).\n\n## Usage\n\n### First, create a base class for your emails\n\n```crystal\nrequire \"carbon\"\n\n# You can setup defaults in this class\nabstract class BaseEmail < Carbon::Email\n # For example, set up a default 'from' address\n from Carbon::Address.new(\"My App Name\", \"support@myapp.com\")\n # Use a string if you just need the email address\n from \"support@myapp.com\"\nend\n```\n\n### Configure the mailer class\n\n```crystal\nBaseEmail.configure do |settings|\n settings.adapter = Carbon::DevAdapter.new(print_emails: true)\nend\n```\n\n### Create a class for your email\n\n```crystal\n# Create an email class\nclass WelcomeEmail < BaseEmail\n def initialize(@name : String, @email_address : String)\n end\n\n to @email_address\n subject \"Welcome, #{@name}!\"\n header \"My-Custom-Header\", \"header-value\"\n reply_to \"no-reply@noreply.com\"\n # You can also do just `text` or `html` if you don't want both\n templates text, html\nend\n```\n\n### Create templates\n\nTemplates go in the same folder the email is in:\n\n- Text email: `/templates//text.ecr`\n- HTML email: `/templates//html.ecr`\n\nSo if your email class is in `src/emails/welcome_email.cr`, then your\ntemplates would go in `src/emails/templates/welcome_email/text|html.ecr`.\n\n```\n# in /templates/welcome_email/text.ecr\n# Templates have access to instance variables and methods in the email.\nWelcome, <%= @name %>!\n```\n\n```\n# in /templates/welcome_email/html.ecr\n

    Welcome, <%= @name %>!

    \n```\n\nFor more information on what you can do with Embedded Crystal (ECR), see [the official Crystal documentation](https://crystal-lang.org/api/latest/ECR.html).\n\n### Template layouts\n\nLayouts are optional allowing you to specify how each email template looks individually.\nIf you'd like to have the same layout on each, you can create a layout template in\n`/templates//layout.ecr`\n\nIn this file, you'll yield the main email body with `<%= content %>`. Then in your `BaseEmail`, you can specify the name of the layout.\n\n```crystal\nabstract class BaseEmail < Carbon::Email\n macro inherited\n from default_from\n layout :application_layout\n end\nend\n```\n\n```\n# in src/emails/templates/application_layout/layout.ecr\n\n

    Our Email

    \n\n<%= content %>\n\n
    footer
    \n```\n\n### Deliver the email\n\n```\n# Send the email right away!\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver\n\n# Send the email in the background using `spawn`\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver_later\n```\n\n### Delay email delivery\n\nThe built-in delay uses the `deliver_later_strategy` setting set to `Carbon::SpawnStrategy`. You can create your own custom delayed strategy\nthat inherits from `Carbon::DeliverLaterStrategy` and defines a `run` method that takes a `Carbon::Email` and a block.\n\nOne example might be a job processor:\n\n```crystal\n# Define your new delayed strategy\nclass SendEmailInJobStrategy < Carbon::DeliverLaterStrategy\n\n # `block.call` will run `deliver`, but you can call\n # `deliver` yourself on the `email` when you need.\n def run(email : Carbon::Email, &block)\n EmailJob.perform_later(email)\n end\nend\n\nclass EmailJob < JobProcessor\n def perform(email : Carbon::Email)\n email.deliver\n end\nend\n\n# configure to use your new delayed strategy\nBaseEmail.configure do |settings|\n settings.deliver_later_strategy = SendEmailInJobStrategy.new\nend\n```\n\n## Testing\n\n### Change the adapter\n\n```crystal\n# In spec/spec_helper.cr or wherever you configure your code\nBaseEmail.configure do\n # This adapter will capture all emails in memory\n settings.adapter = Carbon::DevAdapter.new\nend\n```\n\n### Reset emails before each spec and include expectations\n\n```crystal\n# In spec/spec_helper.cr\n\n# This gives you the `be_delivered` expectation\ninclude Carbon::Expectations\n\nSpec.before_each do\n Carbon::DevAdapter.reset\nend\n```\n\n### Integration testing\n\n```crystal\n# Let's say we have a class that signs the user up and sends the welcome email\n# that was described at the beginning of the README\nclass SignUpUser\n def initialize(@name : String, @email_address : String)\n end\n\n def run\n sign_user_up\n WelcomeEmail.new(name: @name, email_address: @email_address).deliver\n end\nend\n\nit \"sends an email after the user signs up\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n # Test that this email was sent\n WelcomeEmail.new(name: \"Emily\", email_address: \"em@gmail.com\").should be_delivered\nend\n\n# or we can just check that some emails were sent\nit \"sends some emails\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n Carbon.should have_delivered_emails\nend\n```\n\n### Unit testing\n\nUnit testing is simple. Instantiate your email and test the fields you care about.\n\n```crystal\nit \"builds a nice welcome email\" do\n email = WelcomeEmail.new(name: \"David\", email_address: \"david@gmail.com\")\n # Note that recipients are converted to an array of Carbon::Address\n # So if you use a string value for the `to` field, you'll get an array of\n # Carbon::Address instead.\n email.to.should eq [Carbon::Address.new(\"david@gmail.com\")]\n email.text_body.should contain \"Welcome\"\n email.html_body.should contain \"Welcome\"\nend\n```\n\n> Note that unit testing can be superfluous in most cases. Instead, try\n> unit testing just fields that have complex logic. The compiler will catch most\n> other issues.\n\n## Development\n\n- `shards install`\n- Make changes\n- `./script/test`\n- `./bin/ameba`\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/carbon/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Make your changes\n4. Run `./script/test` to run the specs, build shards, and check formatting\n5. Commit your changes (git commit -am 'Add some feature')\n6. Push to the branch (git push origin my-new-feature)\n7. Create a new Pull Request\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator\n","program":{"html_id":"carbon/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"carbon","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Carbon","path":"Carbon.html","kind":"module","full_name":"Carbon","name":"Carbon","abstract":false,"locations":[{"filename":"src/carbon.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon.cr#L7"},{"filename":"src/carbon/attachment.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L1"},{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L1"},{"filename":"src/carbon/version.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/version.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"\"0.5.0\""}],"types":[{"html_id":"carbon/Carbon/Adapter","path":"Carbon/Adapter.html","kind":"class","full_name":"Carbon::Adapter","name":"Adapter","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/DevAdapter","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapter.cr#L2"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/Address","path":"Carbon/Address.html","kind":"class","full_name":"Carbon::Address","name":"Address","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/address.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(name:String,address:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(name : String, address : String)","args_html":"(name : String, address : String)","location":{"filename":"src/carbon/address.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(address:String)-class-method","name":"new","abstract":false,"args":[{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(address : String)","args_html":"(address : String)","location":{"filename":"src/carbon/address.cr","line_number":12,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L12"},"def":{"name":"new","args":[{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/address.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L7"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif name == other.name\nelse\n return false\nend\nif address == other.address\nelse\n return false\nend\ntrue\n"}},{"html_id":"address:String-instance-method","name":"address","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L6"},"def":{"name":"address","visibility":"Public","body":"@address"}},{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L18"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"self"}},{"html_id":"name:String?-instance-method","name":"name","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L6"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"to_s(io:IO)-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

    Appends a short String representation of this object which includes its class name and its object address.

    ","abstract":false,"args":[{"name":"io","external_name":"io","restriction":"IO"}],"args_string":"(io : IO)","args_html":"(io : IO)","location":{"filename":"src/carbon/address.cr","line_number":22,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L22"},"def":{"name":"to_s","args":[{"name":"io","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"io << to_s"}},{"html_id":"to_s:String-instance-method","name":"to_s","doc":"Returns a nicely readable and concise string representation of this object,\ntypically intended for users.\n\nThis method should usually **not** be overridden. It delegates to\n`#to_s(IO)` which can be overridden for custom implementations.\n\nAlso see `#inspect`.","summary":"

    Returns a nicely readable and concise string representation of this object, typically intended for users.

    ","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":26,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L26"},"def":{"name":"to_s","return_type":"String","visibility":"Public","body":"if @name\n \"\\\"#{@name}\\\" <#{@address}>\"\nelse\n @address\nend"}}]},{"html_id":"carbon/Carbon/AttachFile","path":"Carbon/AttachFile.html","kind":"alias","full_name":"Carbon::AttachFile","name":"AttachFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L2"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/AttachIO","path":"Carbon/AttachIO.html","kind":"alias","full_name":"Carbon::AttachIO","name":"AttachIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Attachment","path":"Carbon/Attachment.html","kind":"alias","full_name":"Carbon::Attachment","name":"Attachment","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil) | NamedTuple(io: IO, file_name: String, mime_type: String | Nil))","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Callbacks","path":"Carbon/Callbacks.html","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/carbon/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"macros":[{"html_id":"after_send(method_name)-macro","name":"after_send","doc":"Runs the given method after the adapter calls `deliver_now`.\nPasses in the return value of the adapter's `deliver_now` method.\n\n```\nafter_send :mark_email_as_sent\n\nprivate def mark_email_as_sent(response)\n # ...\nend\n```","summary":"

    Runs the given method after the adapter calls deliver_now.

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":46,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L46"},"def":{"name":"after_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_send do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_send(&block)-macro","name":"after_send","doc":"Runs the block after the adapter calls `deliver_now`, and passes the\nreturn value of the adapter's `deliver_now` method to the block.\n\n```\nafter_send do |response|\n # ...\nend\n```","summary":"

    Runs the block after the adapter calls deliver_now, and passes the return value of the adapter's deliver_now method to the block.

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L60"},"def":{"name":"after_send","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_send' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_send { |value| some_method(value) }\")\nend %}\n\n def after_send(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"before_send(method_name)-macro","name":"before_send","doc":"Runs the given method before the adapter calls `deliver_now`\n\n```\nbefore_send :attach_metadata\n\nprivate def attach_metadata\n # ...\nend\n```","summary":"

    Runs the given method before the adapter calls deliver_now

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L11"},"def":{"name":"before_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_send do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_send-macro","name":"before_send","doc":"Runs the block before the adapter calls `deliver_now`\n\n```\nbefore_send do\n # ...\nend\n```","summary":"

    Runs the block before the adapter calls deliver_now

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":24,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L24"},"def":{"name":"before_send","visibility":"Public","body":" def before_send\n \n{% if @type.methods.map(&.name).includes?((:before_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"carbon/Carbon/DeliverLaterStrategy","path":"Carbon/DeliverLaterStrategy.html","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/deliver_later_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/deliver_later_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/SpawnStrategy","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email:Carbon::Email,&)-instance-method","name":"run","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email, &)","args_html":"(email : Carbon::Email, &)","location":{"filename":"src/carbon/deliver_later_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/deliver_later_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"yields":0,"block_arity":0,"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/DevAdapter","path":"Carbon/DevAdapter.html","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter","abstract":false,"superclass":{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},"ancestors":[{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"class_methods":[{"html_id":"delivered?(email):Bool-class-method","name":"delivered?","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email) : Bool","args_html":"(email) : Bool","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L15"},"def":{"name":"delivered?","args":[{"name":"email","external_name":"email","restriction":""}],"return_type":"Bool","visibility":"Public","body":"delivered_emails.any?(&.==(email))"}},{"html_id":"delivered_emails-class-method","name":"delivered_emails","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L2"},"def":{"name":"delivered_emails","visibility":"Public","body":"@@delivered_emails"}},{"html_id":"reset-class-method","name":"reset","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":19,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L19"},"def":{"name":"reset","visibility":"Public","body":"@@delivered_emails.clear"}}],"constructors":[{"html_id":"new(print_emails:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"args_string":"(print_emails : Bool = false)","args_html":"(print_emails : Bool = false)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L4"},"def":{"name":"new","args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(print_emails)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L8"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":"@@delivered_emails << email\nif @print_emails\n print_email(email)\nend\n"}}]},{"html_id":"carbon/Carbon/Email","path":"Carbon/Email.html","kind":"class","full_name":"Carbon::Email","name":"Email","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/email.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/email.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L11"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif subject == other.subject\nelse\n return false\nend\nif from == other.from\nelse\n return false\nend\nif to == other.to\nelse\n return false\nend\nif cc == other.cc\nelse\n return false\nend\nif bcc == other.bcc\nelse\n return false\nend\nif headers == other.headers\nelse\n return false\nend\nif text_body == other.text_body\nelse\n return false\nend\nif html_body == other.html_body\nelse\n return false\nend\nif attachments == other.attachments\nelse\n return false\nend\ntrue\n"}},{"html_id":"after_send(result)-instance-method","name":"after_send","abstract":false,"args":[{"name":"result","external_name":"result","restriction":""}],"args_string":"(result)","args_html":"(result)","location":{"filename":"src/carbon/email.cr","line_number":35,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L35"},"def":{"name":"after_send","args":[{"name":"result","external_name":"result","restriction":""}],"visibility":"Public","body":""}},{"html_id":"attachments:Array({file_path:String,cid:String,file_name:String?,mime_type:String?}|{file_path:String,file_name:String?,mime_type:String?}|{io:IO,cid:String,file_name:String,mime_type:String?}|{io:IO,file_name:String,mime_type:String?})-instance-method","name":"attachments","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":95,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L95"},"def":{"name":"attachments","visibility":"Public","body":"@attachments"}},{"html_id":"bcc-instance-method","name":"bcc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":21,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L21"},"def":{"name":"bcc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"before_send-instance-method","name":"before_send","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L33"},"def":{"name":"before_send","visibility":"Public","body":""}},{"html_id":"cc-instance-method","name":"cc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":17,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L17"},"def":{"name":"cc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"deliver-instance-method","name":"deliver","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":145,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L145"},"def":{"name":"deliver","visibility":"Public","body":"before_send\nif deliverable?\n response = settings.adapter.deliver_now(self)\n after_send(response)\nend\n"}},{"html_id":"deliver_later-instance-method","name":"deliver_later","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":154,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L154"},"def":{"name":"deliver_later","visibility":"Public","body":"settings.deliver_later_strategy.run(self) do\n deliver\nend"}},{"html_id":"deliverable=(deliverable:Bool)-instance-method","name":"deliverable=","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"args_string":"(deliverable : Bool)","args_html":"(deliverable : Bool)","location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L15"},"def":{"name":"deliverable=","args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"visibility":"Public","body":"@deliverable = deliverable"}},{"html_id":"deliverable?:Bool-instance-method","name":"deliverable?","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L15"},"def":{"name":"deliverable?","return_type":"Bool","visibility":"Public","body":"@deliverable"}},{"html_id":"from:Carbon::Address-instance-method","name":"from","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L8"},"def":{"name":"from","return_type":"Carbon::Address","visibility":"Public","body":""}},{"html_id":"headers:Hash(String,String)-instance-method","name":"headers","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":37,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L37"},"def":{"name":"headers","visibility":"Public","body":"@headers"}},{"html_id":"html_body-instance-method","name":"html_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":29,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L29"},"def":{"name":"html_body","visibility":"Public","body":""}},{"html_id":"html_layout(content_io:IO)-instance-method","name":"html_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":31,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L31"},"def":{"name":"html_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"subject:String-instance-method","name":"subject","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L7"},"def":{"name":"subject","return_type":"String","visibility":"Public","body":""}},{"html_id":"text_body-instance-method","name":"text_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":25,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L25"},"def":{"name":"text_body","visibility":"Public","body":""}},{"html_id":"text_layout(content_io:IO)-instance-method","name":"text_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":27,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L27"},"def":{"name":"text_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"to:Array(Carbon::Address)-instance-method","name":"to","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":9,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L9"},"def":{"name":"to","return_type":"Array(Carbon::Address)","visibility":"Public","body":""}}],"macros":[{"html_id":"attachment(value)-macro","name":"attachment","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":97,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L97"},"def":{"name":"attachment","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def attachments : Array(Carbon::Attachment)\n \n{% if @type.methods.map(&.name).includes?(\"attachments\".id) %}\n previous_def\n {% end %}\n\n @attachments << \n{{ value }}\n\n \nend\n \n"}},{"html_id":"bcc(value)-macro","name":"bcc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"bcc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def bcc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"cc(value)-macro","name":"cc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"cc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def cc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"configure-macro","name":"configure","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":141,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L141"},"def":{"name":"configure","visibility":"Public","body":" \n{% raise(\"Make #{@type.name} abstract in order to configure it.\") %}\n\n \n"}},{"html_id":"from(value)-macro","name":"from","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":82,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L82"},"def":{"name":"from","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def from : Carbon::Address\n normalize(id_or_method(\n{{ value }}\n)).first\n \nend\n \n"}},{"html_id":"header(key,value)-macro","name":"header","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"args_string":"(key, value)","args_html":"(key, value)","location":{"filename":"src/carbon/email.cr","line_number":72,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L72"},"def":{"name":"header","args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def headers : Hash(String, String)\n \n{% if @type.methods.map(&.name).includes?((:headers).id) %}\n previous_def\n {% end %}\n\n @headers[\n{{ key }}\n] = \n{{ value }}\n\n @headers\n \nend\n \n"}},{"html_id":"id_or_method(value)-macro","name":"id_or_method","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":114,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L114"},"def":{"name":"id_or_method","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" \n{% if value.is_a?(SymbolLiteral) %}\n {{ value.id }}\n {% else %}\n {{ value }}\n {% end %}\n\n \n"}},{"html_id":"reply_to(address)-macro","name":"reply_to","abstract":false,"args":[{"name":"address","external_name":"address","restriction":""}],"args_string":"(address)","args_html":"(address)","location":{"filename":"src/carbon/email.cr","line_number":68,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L68"},"def":{"name":"reply_to","args":[{"name":"address","external_name":"address","restriction":""}],"visibility":"Public","body":" header \"Reply-To\", \n{{ address }}\n\n \n"}},{"html_id":"subject(value)-macro","name":"subject","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":88,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L88"},"def":{"name":"subject","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def subject : String\n id_or_method(\n{{ value }}\n)\n \nend\n \n"}},{"html_id":"to(value)-macro","name":"to","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"to","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def to : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}}],"types":[{"html_id":"carbon/Carbon/Email/Recipients","path":"Carbon/Email/Recipients.html","kind":"alias","full_name":"Carbon::Email::Recipients","name":"Recipients","abstract":false,"locations":[{"filename":"src/carbon/email.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(Array(Carbon::Emailable) | Carbon::Emailable)","aliased_html":"Array(Carbon::Emailable) | Carbon::Emailable","const":false,"namespace":{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}}]},{"html_id":"carbon/Carbon/Emailable","path":"Carbon/Emailable.html","kind":"module","full_name":"Carbon::Emailable","name":"Emailable","abstract":false,"locations":[{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Address","kind":"class","full_name":"Carbon::Address","name":"Address"},{"html_id":"carbon/String","kind":"class","full_name":"String","name":"String"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"carbon_address:Carbon::Address-instance-method","name":"carbon_address","doc":"Adapter's should use this to get the Carbon::Address","summary":"

    Adapter's should use this to get the Carbon::Address

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L5"},"def":{"name":"carbon_address","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable)"}},{"html_id":"carbon_address_for_from:Carbon::Address-instance-method","name":"carbon_address_for_from","doc":"Adapter's should use this to get the Carbon::Address when used for 'from'","summary":"

    Adapter's should use this to get the Carbon::Address when used for 'from'

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L10"},"def":{"name":"carbon_address_for_from","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable_for_from)"}}]},{"html_id":"carbon/Carbon/EmailTemplate","path":"Carbon/EmailTemplate.html","kind":"class","full_name":"Carbon::EmailTemplate","name":"EmailTemplate","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(email_filename:String,email_class_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"args_string":"(email_filename : String, email_class_name : String)","args_html":"(email_filename : String, email_class_name : String)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L7"},"def":{"name":"new","args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(email_filename, email_class_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"render(path:Path)-instance-method","name":"render","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path"}],"args_string":"(path : Path)","args_html":"(path : Path)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L10"},"def":{"name":"render","args":[{"name":"path","external_name":"path","restriction":"Path"}],"visibility":"Public","body":"LuckyTemplate.write!(path, template_folder)"}},{"html_id":"template_folder-instance-method","name":"template_folder","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":14,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L14"},"def":{"name":"template_folder","visibility":"Public","body":"LuckyTemplate.create_folder do |top_dir|\n top_dir.add_folder(Path[\"src/emails/templates\"]) do |templates_dir|\n templates_dir.add_file(\"#{@email_filename}_email.cr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/email.cr.ecr\", io)\n end\n templates_dir.add_folder(\"#{@email_filename}_email\") do |email_templates_dir|\n email_templates_dir.add_file(\"html.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/html.ecr.ecr\", io)\n end\n email_templates_dir.add_file(\"text.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/text.ecr.ecr\", io)\n end\n end\n end\nend"}}]},{"html_id":"carbon/Carbon/Expectations","path":"Carbon/Expectations.html","kind":"module","full_name":"Carbon::Expectations","name":"Expectations","abstract":false,"locations":[{"filename":"src/carbon/expectations.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations.cr#L3"},{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"types":[{"html_id":"carbon/Carbon/Expectations/BeDeliveredExpectation","path":"Carbon/Expectations/BeDeliveredExpectation.html","kind":"struct","full_name":"Carbon::Expectations::BeDeliveredExpectation","name":"BeDeliveredExpectation","abstract":false,"superclass":{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"carbon/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"failure_message(email)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"String.build do |message|\n message << \"Expected: #{email} to be delivered\"\n if Carbon::DevAdapter.delivered_emails.empty?\n message << \", but no emails were delivered\"\n else\n message << \"\\n\\nTry this...\"\n message << \"\\n\\n ▸ See what emails were delivered with 'p Carbon::DevAdapter.delivered_emails'\"\n end\nend"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"match(email:Carbon::Email):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email) : Bool","args_html":"(email : Carbon::Email) : Bool","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"return_type":"Bool","visibility":"Public","body":"Carbon::DevAdapter.delivered?(email)"}},{"html_id":"negative_failure_message(email)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L18"},"def":{"name":"negative_failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"\"Expected: #{email} not to be delivered\""}}]},{"html_id":"carbon/Carbon/Expectations/HaveDeliveredEmailsExpectation","path":"Carbon/Expectations/HaveDeliveredEmailsExpectation.html","kind":"class","full_name":"Carbon::Expectations::HaveDeliveredEmailsExpectation","name":"HaveDeliveredEmailsExpectation","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"instance_methods":[{"html_id":"failure_message(_carbon:Carbon.class)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have delivered emails, but found none\""}},{"html_id":"match(_carbon:Carbon.class):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class) : Bool","args_html":"(_carbon : Carbon.class) : Bool","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"return_type":"Bool","visibility":"Public","body":"!Carbon::DevAdapter.delivered_emails.empty?"}},{"html_id":"negative_failure_message(_carbon:Carbon.class)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L10"},"def":{"name":"negative_failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have no delivered emails, but found some\""}}]}]},{"html_id":"carbon/Carbon/ResourceFile","path":"Carbon/ResourceFile.html","kind":"alias","full_name":"Carbon::ResourceFile","name":"ResourceFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L4"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/ResourceIO","path":"Carbon/ResourceIO.html","kind":"alias","full_name":"Carbon::ResourceIO","name":"ResourceIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, cid: String, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/SpawnStrategy","path":"Carbon/SpawnStrategy.html","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy","abstract":false,"superclass":{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},"ancestors":[{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/spawn_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/spawn_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email,&block)-instance-method","name":"run","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email, &block)","args_html":"(email, &block)","location":{"filename":"src/carbon/spawn_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/spawn_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"spawn do\n block.call\nend"}}]}]},{"html_id":"carbon/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Gen/Email","path":"Gen/Email.html","kind":"class","full_name":"Gen::Email","name":"Email","abstract":false,"superclass":{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:email_name] of Symbol"}],"included_modules":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"carbon/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

    The help text to be displayed when a help flag is passed in (e.g.

    ","abstract":false,"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new email with html and text formats.\\nThe email name must be CamelCase. No other options are available.\\nExamples:\\n lucky gen.email WelcomeUser\\n lucky gen.email SubscriptionRenewed\\n lucky gen.email ResetPassword\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

    The name of your task as derived by the class name Use the .task_name macro to define a custom task name

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.email\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

    By default, task summaries are optional.

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":36,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L36"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new Email\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":54,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L54"},"def":{"name":"call","visibility":"Public","body":"email_template.render(Path[\".\"])\ndisplay_success_messages\n"}},{"html_id":"email_name:String-instance-method","name":"email_name","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"email_name","return_type":"String","visibility":"Public","body":"if @email_name.nil?\n raise(\"email_name is required, but no value was passed.\")\nend\n@email_name.as(String)\n"}},{"html_id":"email_template-instance-method","name":"email_template","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L60"},"def":{"name":"email_template","visibility":"Public","body":"Carbon::EmailTemplate.new(filename, normalized_email_name)"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"set_opt_for_email_name(args:Array(String))-instance-method","name":"set_opt_for_email_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"set_opt_for_email_name","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\nmatches = value.is_a?(Array) ? value.all?(&.=~(/^[A-Z]/)) : value =~ (/^[A-Z]/)\nif !matches\n raise(\"Invalid format for email_name. It should match /^[A-Z]/\\n\\n\")\nend\n@email_name = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]}]},{"html_id":"carbon/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/string_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/string_extensions.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

    A String represents an immutable sequence of UTF-8 characters.

    ","instance_methods":[{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/string_extensions.cr#L6"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"Carbon::Address.new(address: self)"}}]}]}} \ No newline at end of file +{"repository_name":"carbon","body":"# Carbon\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Fcarbon%2F)](https://luckyframework.github.io/carbon)\n\nEmail library written in Crystal.\n\n![code preview](https://user-images.githubusercontent.com/22394/38457909-9f16f9fe-3a64-11e8-852c-74e31238f48b.png)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n carbon:\n github: luckyframework/carbon\n```\n\n## Adapters\n\n- `Carbon::SendGridAdapter`- See [luckyframework/carbon_sendgrid_adapter](https://github.com/luckyframework/carbon_sendgrid_adapter).\n- `Carbon::SmtpAdapter` - See [luckyframework/carbon_smtp_adapter](https://github.com/luckyframework/carbon_smtp_adapter).\n- `Carbon::AwsSesAdapter` - See [keizo3/carbon_aws_ses_adapter](https://github.com/keizo3/carbon_aws_ses_adapter).\n- `Carbon::SendInBlueAdapter` - See [atnos/carbon_send_in_blue_adapter](https://github.com/atnos/carbon_send_in_blue_adapter).\n- `Carbon::MailgunAdapter` - See [atnos/carbon_mailgun_adapter](https://github.com/atnos/carbon_mailgun_adapter).\n- `Carbon::SparkPostAdapter` - See [Swiss-Crystal/carbon_sparkpost_adapter](https://github.com/Swiss-Crystal/carbon_sparkpost_adapter).\n- `Carbon::PostmarkAdapter` - See [makisu/carbon_postmark_adapter](https://github.com/makisu/carbon_postmark_adapter).\n- `Carbon::MailersendAdapter` - See [balakhorvathnorbert/carbon_mailersend_adapter](https://github.com/balakhorvathnorbert/carbon_mailersend_adapter).\n\n## Usage\n\n### First, create a base class for your emails\n\n```crystal\nrequire \"carbon\"\n\n# You can setup defaults in this class\nabstract class BaseEmail < Carbon::Email\n # For example, set up a default 'from' address\n from Carbon::Address.new(\"My App Name\", \"support@myapp.com\")\n # Use a string if you just need the email address\n from \"support@myapp.com\"\nend\n```\n\n### Configure the mailer class\n\n```crystal\nBaseEmail.configure do |settings|\n settings.adapter = Carbon::DevAdapter.new(print_emails: true)\nend\n```\n\n### Create a class for your email\n\n```crystal\n# Create an email class\nclass WelcomeEmail < BaseEmail\n def initialize(@name : String, @email_address : String)\n end\n\n to @email_address\n subject \"Welcome, #{@name}!\"\n header \"My-Custom-Header\", \"header-value\"\n reply_to \"no-reply@noreply.com\"\n # You can also do just `text` or `html` if you don't want both\n templates text, html\nend\n```\n\n### Create templates\n\nTemplates go in the same folder the email is in:\n\n- Text email: `/templates//text.ecr`\n- HTML email: `/templates//html.ecr`\n\nSo if your email class is in `src/emails/welcome_email.cr`, then your\ntemplates would go in `src/emails/templates/welcome_email/text|html.ecr`.\n\n```\n# in /templates/welcome_email/text.ecr\n# Templates have access to instance variables and methods in the email.\nWelcome, <%= @name %>!\n```\n\n```\n# in /templates/welcome_email/html.ecr\n

    Welcome, <%= @name %>!

    \n```\n\nFor more information on what you can do with Embedded Crystal (ECR), see [the official Crystal documentation](https://crystal-lang.org/api/latest/ECR.html).\n\n### Template layouts\n\nLayouts are optional allowing you to specify how each email template looks individually.\nIf you'd like to have the same layout on each, you can create a layout template in\n`/templates//layout.ecr`\n\nIn this file, you'll yield the main email body with `<%= content %>`. Then in your `BaseEmail`, you can specify the name of the layout.\n\n```crystal\nabstract class BaseEmail < Carbon::Email\n macro inherited\n from default_from\n layout :application_layout\n end\nend\n```\n\n```\n# in src/emails/templates/application_layout/layout.ecr\n\n

    Our Email

    \n\n<%= content %>\n\n
    footer
    \n```\n\n### Deliver the email\n\n```\n# Send the email right away!\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver\n\n# Send the email in the background using `spawn`\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver_later\n```\n\n### Delay email delivery\n\nThe built-in delay uses the `deliver_later_strategy` setting set to `Carbon::SpawnStrategy`. You can create your own custom delayed strategy\nthat inherits from `Carbon::DeliverLaterStrategy` and defines a `run` method that takes a `Carbon::Email` and a block.\n\nOne example might be a job processor:\n\n```crystal\n# Define your new delayed strategy\nclass SendEmailInJobStrategy < Carbon::DeliverLaterStrategy\n\n # `block.call` will run `deliver`, but you can call\n # `deliver` yourself on the `email` when you need.\n def run(email : Carbon::Email, &block)\n EmailJob.perform_later(email)\n end\nend\n\nclass EmailJob < JobProcessor\n def perform(email : Carbon::Email)\n email.deliver\n end\nend\n\n# configure to use your new delayed strategy\nBaseEmail.configure do |settings|\n settings.deliver_later_strategy = SendEmailInJobStrategy.new\nend\n```\n\n## Testing\n\n### Change the adapter\n\n```crystal\n# In spec/spec_helper.cr or wherever you configure your code\nBaseEmail.configure do\n # This adapter will capture all emails in memory\n settings.adapter = Carbon::DevAdapter.new\nend\n```\n\n### Reset emails before each spec and include expectations\n\n```crystal\n# In spec/spec_helper.cr\n\n# This gives you the `be_delivered` expectation\ninclude Carbon::Expectations\n\nSpec.before_each do\n Carbon::DevAdapter.reset\nend\n```\n\n### Integration testing\n\n```crystal\n# Let's say we have a class that signs the user up and sends the welcome email\n# that was described at the beginning of the README\nclass SignUpUser\n def initialize(@name : String, @email_address : String)\n end\n\n def run\n sign_user_up\n WelcomeEmail.new(name: @name, email_address: @email_address).deliver\n end\nend\n\nit \"sends an email after the user signs up\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n # Test that this email was sent\n WelcomeEmail.new(name: \"Emily\", email_address: \"em@gmail.com\").should be_delivered\nend\n\n# or we can just check that some emails were sent\nit \"sends some emails\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n Carbon.should have_delivered_emails\nend\n```\n\n### Unit testing\n\nUnit testing is simple. Instantiate your email and test the fields you care about.\n\n```crystal\nit \"builds a nice welcome email\" do\n email = WelcomeEmail.new(name: \"David\", email_address: \"david@gmail.com\")\n # Note that recipients are converted to an array of Carbon::Address\n # So if you use a string value for the `to` field, you'll get an array of\n # Carbon::Address instead.\n email.to.should eq [Carbon::Address.new(\"david@gmail.com\")]\n email.text_body.should contain \"Welcome\"\n email.html_body.should contain \"Welcome\"\nend\n```\n\n> Note that unit testing can be superfluous in most cases. Instead, try\n> unit testing just fields that have complex logic. The compiler will catch most\n> other issues.\n\n## Development\n\n- `shards install`\n- Make changes\n- `./script/test`\n- `./bin/ameba`\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/carbon/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Make your changes\n4. Run `./script/test` to run the specs, build shards, and check formatting\n5. Commit your changes (git commit -am 'Add some feature')\n6. Push to the branch (git push origin my-new-feature)\n7. Create a new Pull Request\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator\n","program":{"html_id":"carbon/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"carbon","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Carbon","path":"Carbon.html","kind":"module","full_name":"Carbon","name":"Carbon","abstract":false,"locations":[{"filename":"src/carbon.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon.cr#L7"},{"filename":"src/carbon/attachment.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L1"},{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L1"},{"filename":"src/carbon/version.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/version.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"\"0.5.0\""}],"types":[{"html_id":"carbon/Carbon/Adapter","path":"Carbon/Adapter.html","kind":"class","full_name":"Carbon::Adapter","name":"Adapter","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/DevAdapter","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapter.cr#L2"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/Address","path":"Carbon/Address.html","kind":"class","full_name":"Carbon::Address","name":"Address","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/address.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(name:String,address:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(name : String, address : String)","args_html":"(name : String, address : String)","location":{"filename":"src/carbon/address.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(address:String)-class-method","name":"new","abstract":false,"args":[{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(address : String)","args_html":"(address : String)","location":{"filename":"src/carbon/address.cr","line_number":12,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L12"},"def":{"name":"new","args":[{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/address.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L7"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif name == other.name\nelse\n return false\nend\nif address == other.address\nelse\n return false\nend\ntrue\n"}},{"html_id":"address:String-instance-method","name":"address","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L6"},"def":{"name":"address","visibility":"Public","body":"@address"}},{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L18"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"self"}},{"html_id":"name:String?-instance-method","name":"name","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L6"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"to_s(io:IO)-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

    Appends a short String representation of this object which includes its class name and its object address.

    ","abstract":false,"args":[{"name":"io","external_name":"io","restriction":"IO"}],"args_string":"(io : IO)","args_html":"(io : IO)","location":{"filename":"src/carbon/address.cr","line_number":22,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L22"},"def":{"name":"to_s","args":[{"name":"io","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"io << to_s"}},{"html_id":"to_s:String-instance-method","name":"to_s","doc":"Returns a nicely readable and concise string representation of this object,\ntypically intended for users.\n\nThis method should usually **not** be overridden. It delegates to\n`#to_s(IO)` which can be overridden for custom implementations.\n\nAlso see `#inspect`.","summary":"

    Returns a nicely readable and concise string representation of this object, typically intended for users.

    ","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":26,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L26"},"def":{"name":"to_s","return_type":"String","visibility":"Public","body":"if @name\n \"\\\"#{@name}\\\" <#{@address}>\"\nelse\n @address\nend"}}]},{"html_id":"carbon/Carbon/AttachFile","path":"Carbon/AttachFile.html","kind":"alias","full_name":"Carbon::AttachFile","name":"AttachFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L2"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/AttachIO","path":"Carbon/AttachIO.html","kind":"alias","full_name":"Carbon::AttachIO","name":"AttachIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Attachment","path":"Carbon/Attachment.html","kind":"alias","full_name":"Carbon::Attachment","name":"Attachment","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil) | NamedTuple(io: IO, file_name: String, mime_type: String | Nil))","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Callbacks","path":"Carbon/Callbacks.html","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/carbon/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"macros":[{"html_id":"after_send(method_name)-macro","name":"after_send","doc":"Runs the given method after the adapter calls `deliver_now`.\nPasses in the return value of the adapter's `deliver_now` method.\n\n```\nafter_send :mark_email_as_sent\n\nprivate def mark_email_as_sent(response)\n # ...\nend\n```","summary":"

    Runs the given method after the adapter calls deliver_now.

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":46,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L46"},"def":{"name":"after_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_send do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_send(&block)-macro","name":"after_send","doc":"Runs the block after the adapter calls `deliver_now`, and passes the\nreturn value of the adapter's `deliver_now` method to the block.\n\n```\nafter_send do |response|\n # ...\nend\n```","summary":"

    Runs the block after the adapter calls deliver_now, and passes the return value of the adapter's deliver_now method to the block.

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L60"},"def":{"name":"after_send","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_send' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_send { |value| some_method(value) }\")\nend %}\n\n def after_send(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"before_send(method_name)-macro","name":"before_send","doc":"Runs the given method before the adapter calls `deliver_now`\n\n```\nbefore_send :attach_metadata\n\nprivate def attach_metadata\n # ...\nend\n```","summary":"

    Runs the given method before the adapter calls deliver_now

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L11"},"def":{"name":"before_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_send do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_send-macro","name":"before_send","doc":"Runs the block before the adapter calls `deliver_now`\n\n```\nbefore_send do\n # ...\nend\n```","summary":"

    Runs the block before the adapter calls deliver_now

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":24,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L24"},"def":{"name":"before_send","visibility":"Public","body":" def before_send\n \n{% if @type.methods.map(&.name).includes?((:before_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"carbon/Carbon/DeliverLaterStrategy","path":"Carbon/DeliverLaterStrategy.html","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/deliver_later_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/deliver_later_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/SpawnStrategy","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email:Carbon::Email,&)-instance-method","name":"run","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email, &)","args_html":"(email : Carbon::Email, &)","location":{"filename":"src/carbon/deliver_later_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/deliver_later_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"yields":0,"block_arity":0,"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/DevAdapter","path":"Carbon/DevAdapter.html","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter","abstract":false,"superclass":{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},"ancestors":[{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"class_methods":[{"html_id":"delivered?(email):Bool-class-method","name":"delivered?","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email) : Bool","args_html":"(email) : Bool","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L15"},"def":{"name":"delivered?","args":[{"name":"email","external_name":"email","restriction":""}],"return_type":"Bool","visibility":"Public","body":"delivered_emails.any?(&.==(email))"}},{"html_id":"delivered_emails-class-method","name":"delivered_emails","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L2"},"def":{"name":"delivered_emails","visibility":"Public","body":"@@delivered_emails"}},{"html_id":"reset-class-method","name":"reset","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":19,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L19"},"def":{"name":"reset","visibility":"Public","body":"@@delivered_emails.clear"}}],"constructors":[{"html_id":"new(print_emails:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"args_string":"(print_emails : Bool = false)","args_html":"(print_emails : Bool = false)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L4"},"def":{"name":"new","args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(print_emails)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L8"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":"@@delivered_emails << email\nif @print_emails\n print_email(email)\nend\n"}}]},{"html_id":"carbon/Carbon/Email","path":"Carbon/Email.html","kind":"class","full_name":"Carbon::Email","name":"Email","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/email.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/email.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L11"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif subject == other.subject\nelse\n return false\nend\nif from == other.from\nelse\n return false\nend\nif to == other.to\nelse\n return false\nend\nif cc == other.cc\nelse\n return false\nend\nif bcc == other.bcc\nelse\n return false\nend\nif headers == other.headers\nelse\n return false\nend\nif text_body == other.text_body\nelse\n return false\nend\nif html_body == other.html_body\nelse\n return false\nend\nif attachments == other.attachments\nelse\n return false\nend\ntrue\n"}},{"html_id":"after_send(result)-instance-method","name":"after_send","abstract":false,"args":[{"name":"result","external_name":"result","restriction":""}],"args_string":"(result)","args_html":"(result)","location":{"filename":"src/carbon/email.cr","line_number":35,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L35"},"def":{"name":"after_send","args":[{"name":"result","external_name":"result","restriction":""}],"visibility":"Public","body":""}},{"html_id":"attachments-instance-method","name":"attachments","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":94,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L94"},"def":{"name":"attachments","visibility":"Public","body":"[] of Carbon::Attachment"}},{"html_id":"bcc-instance-method","name":"bcc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":21,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L21"},"def":{"name":"bcc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"before_send-instance-method","name":"before_send","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L33"},"def":{"name":"before_send","visibility":"Public","body":""}},{"html_id":"cc-instance-method","name":"cc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":17,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L17"},"def":{"name":"cc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"deliver-instance-method","name":"deliver","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":147,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L147"},"def":{"name":"deliver","visibility":"Public","body":"before_send\nif deliverable?\n response = settings.adapter.deliver_now(self)\n after_send(response)\nend\n"}},{"html_id":"deliver_later-instance-method","name":"deliver_later","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":156,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L156"},"def":{"name":"deliver_later","visibility":"Public","body":"settings.deliver_later_strategy.run(self) do\n deliver\nend"}},{"html_id":"deliverable=(deliverable:Bool)-instance-method","name":"deliverable=","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"args_string":"(deliverable : Bool)","args_html":"(deliverable : Bool)","location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L15"},"def":{"name":"deliverable=","args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"visibility":"Public","body":"@deliverable = deliverable"}},{"html_id":"deliverable?:Bool-instance-method","name":"deliverable?","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L15"},"def":{"name":"deliverable?","return_type":"Bool","visibility":"Public","body":"@deliverable"}},{"html_id":"from:Carbon::Address-instance-method","name":"from","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L8"},"def":{"name":"from","return_type":"Carbon::Address","visibility":"Public","body":""}},{"html_id":"headers:Hash(String,String)-instance-method","name":"headers","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":37,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L37"},"def":{"name":"headers","visibility":"Public","body":"@headers"}},{"html_id":"html_body-instance-method","name":"html_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":29,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L29"},"def":{"name":"html_body","visibility":"Public","body":""}},{"html_id":"html_layout(content_io:IO)-instance-method","name":"html_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":31,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L31"},"def":{"name":"html_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"subject:String-instance-method","name":"subject","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L7"},"def":{"name":"subject","return_type":"String","visibility":"Public","body":""}},{"html_id":"text_body-instance-method","name":"text_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":25,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L25"},"def":{"name":"text_body","visibility":"Public","body":""}},{"html_id":"text_layout(content_io:IO)-instance-method","name":"text_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":27,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L27"},"def":{"name":"text_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"to:Array(Carbon::Address)-instance-method","name":"to","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":9,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L9"},"def":{"name":"to","return_type":"Array(Carbon::Address)","visibility":"Public","body":""}}],"macros":[{"html_id":"attachment(value)-macro","name":"attachment","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":98,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L98"},"def":{"name":"attachment","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def attachments : Array(Carbon::Attachment)\n \n{% if @type.methods.map(&.name).includes?((:attachments).id) %}\n previous_def | [{{ value }}]\n {% else %}\n super | [{{ value }}]\n {% end %}\n\n \nend\n \n"}},{"html_id":"bcc(value)-macro","name":"bcc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"bcc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def bcc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"cc(value)-macro","name":"cc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"cc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def cc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"configure-macro","name":"configure","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":143,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L143"},"def":{"name":"configure","visibility":"Public","body":" \n{% raise(\"Make #{@type.name} abstract in order to configure it.\") %}\n\n \n"}},{"html_id":"from(value)-macro","name":"from","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":82,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L82"},"def":{"name":"from","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def from : Carbon::Address\n normalize(id_or_method(\n{{ value }}\n)).first\n \nend\n \n"}},{"html_id":"header(key,value)-macro","name":"header","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"args_string":"(key, value)","args_html":"(key, value)","location":{"filename":"src/carbon/email.cr","line_number":72,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L72"},"def":{"name":"header","args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def headers : Hash(String, String)\n \n{% if @type.methods.map(&.name).includes?((:headers).id) %}\n previous_def\n {% end %}\n\n @headers[\n{{ key }}\n] = \n{{ value }}\n\n @headers\n \nend\n \n"}},{"html_id":"id_or_method(value)-macro","name":"id_or_method","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":116,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L116"},"def":{"name":"id_or_method","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" \n{% if value.is_a?(SymbolLiteral) %}\n {{ value.id }}\n {% else %}\n {{ value }}\n {% end %}\n\n \n"}},{"html_id":"reply_to(address)-macro","name":"reply_to","abstract":false,"args":[{"name":"address","external_name":"address","restriction":""}],"args_string":"(address)","args_html":"(address)","location":{"filename":"src/carbon/email.cr","line_number":68,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L68"},"def":{"name":"reply_to","args":[{"name":"address","external_name":"address","restriction":""}],"visibility":"Public","body":" header \"Reply-To\", \n{{ address }}\n\n \n"}},{"html_id":"subject(value)-macro","name":"subject","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":88,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L88"},"def":{"name":"subject","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def subject : String\n id_or_method(\n{{ value }}\n)\n \nend\n \n"}},{"html_id":"to(value)-macro","name":"to","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"to","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def to : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}}],"types":[{"html_id":"carbon/Carbon/Email/Recipients","path":"Carbon/Email/Recipients.html","kind":"alias","full_name":"Carbon::Email::Recipients","name":"Recipients","abstract":false,"locations":[{"filename":"src/carbon/email.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(Array(Carbon::Emailable) | Carbon::Emailable)","aliased_html":"Array(Carbon::Emailable) | Carbon::Emailable","const":false,"namespace":{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}}]},{"html_id":"carbon/Carbon/Emailable","path":"Carbon/Emailable.html","kind":"module","full_name":"Carbon::Emailable","name":"Emailable","abstract":false,"locations":[{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Address","kind":"class","full_name":"Carbon::Address","name":"Address"},{"html_id":"carbon/String","kind":"class","full_name":"String","name":"String"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"carbon_address:Carbon::Address-instance-method","name":"carbon_address","doc":"Adapter's should use this to get the Carbon::Address","summary":"

    Adapter's should use this to get the Carbon::Address

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L5"},"def":{"name":"carbon_address","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable)"}},{"html_id":"carbon_address_for_from:Carbon::Address-instance-method","name":"carbon_address_for_from","doc":"Adapter's should use this to get the Carbon::Address when used for 'from'","summary":"

    Adapter's should use this to get the Carbon::Address when used for 'from'

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L10"},"def":{"name":"carbon_address_for_from","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable_for_from)"}}]},{"html_id":"carbon/Carbon/EmailTemplate","path":"Carbon/EmailTemplate.html","kind":"class","full_name":"Carbon::EmailTemplate","name":"EmailTemplate","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(email_filename:String,email_class_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"args_string":"(email_filename : String, email_class_name : String)","args_html":"(email_filename : String, email_class_name : String)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L7"},"def":{"name":"new","args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(email_filename, email_class_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"render(path:Path)-instance-method","name":"render","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path"}],"args_string":"(path : Path)","args_html":"(path : Path)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L10"},"def":{"name":"render","args":[{"name":"path","external_name":"path","restriction":"Path"}],"visibility":"Public","body":"LuckyTemplate.write!(path, template_folder)"}},{"html_id":"template_folder-instance-method","name":"template_folder","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":14,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L14"},"def":{"name":"template_folder","visibility":"Public","body":"LuckyTemplate.create_folder do |top_dir|\n top_dir.add_folder(Path[\"src/emails/templates\"]) do |templates_dir|\n templates_dir.add_file(\"#{@email_filename}_email.cr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/email.cr.ecr\", io)\n end\n templates_dir.add_folder(\"#{@email_filename}_email\") do |email_templates_dir|\n email_templates_dir.add_file(\"html.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/html.ecr.ecr\", io)\n end\n email_templates_dir.add_file(\"text.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/text.ecr.ecr\", io)\n end\n end\n end\nend"}}]},{"html_id":"carbon/Carbon/Expectations","path":"Carbon/Expectations.html","kind":"module","full_name":"Carbon::Expectations","name":"Expectations","abstract":false,"locations":[{"filename":"src/carbon/expectations.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations.cr#L3"},{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"types":[{"html_id":"carbon/Carbon/Expectations/BeDeliveredExpectation","path":"Carbon/Expectations/BeDeliveredExpectation.html","kind":"struct","full_name":"Carbon::Expectations::BeDeliveredExpectation","name":"BeDeliveredExpectation","abstract":false,"superclass":{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"carbon/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"failure_message(email)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"String.build do |message|\n message << \"Expected: #{email} to be delivered\"\n if Carbon::DevAdapter.delivered_emails.empty?\n message << \", but no emails were delivered\"\n else\n message << \"\\n\\nTry this...\"\n message << \"\\n\\n ▸ See what emails were delivered with 'p Carbon::DevAdapter.delivered_emails'\"\n end\nend"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"match(email:Carbon::Email):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email) : Bool","args_html":"(email : Carbon::Email) : Bool","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"return_type":"Bool","visibility":"Public","body":"Carbon::DevAdapter.delivered?(email)"}},{"html_id":"negative_failure_message(email)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L18"},"def":{"name":"negative_failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"\"Expected: #{email} not to be delivered\""}}]},{"html_id":"carbon/Carbon/Expectations/HaveDeliveredEmailsExpectation","path":"Carbon/Expectations/HaveDeliveredEmailsExpectation.html","kind":"class","full_name":"Carbon::Expectations::HaveDeliveredEmailsExpectation","name":"HaveDeliveredEmailsExpectation","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"instance_methods":[{"html_id":"failure_message(_carbon:Carbon.class)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have delivered emails, but found none\""}},{"html_id":"match(_carbon:Carbon.class):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class) : Bool","args_html":"(_carbon : Carbon.class) : Bool","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"return_type":"Bool","visibility":"Public","body":"!Carbon::DevAdapter.delivered_emails.empty?"}},{"html_id":"negative_failure_message(_carbon:Carbon.class)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L10"},"def":{"name":"negative_failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have no delivered emails, but found some\""}}]}]},{"html_id":"carbon/Carbon/ResourceFile","path":"Carbon/ResourceFile.html","kind":"alias","full_name":"Carbon::ResourceFile","name":"ResourceFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L4"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/ResourceIO","path":"Carbon/ResourceIO.html","kind":"alias","full_name":"Carbon::ResourceIO","name":"ResourceIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, cid: String, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/SpawnStrategy","path":"Carbon/SpawnStrategy.html","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy","abstract":false,"superclass":{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},"ancestors":[{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/spawn_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/spawn_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email,&block)-instance-method","name":"run","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email, &block)","args_html":"(email, &block)","location":{"filename":"src/carbon/spawn_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/spawn_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"spawn do\n block.call\nend"}}]}]},{"html_id":"carbon/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Gen/Email","path":"Gen/Email.html","kind":"class","full_name":"Gen::Email","name":"Email","abstract":false,"superclass":{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:email_name] of Symbol"}],"included_modules":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"carbon/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

    The help text to be displayed when a help flag is passed in (e.g.

    ","abstract":false,"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new email with html and text formats.\\nThe email name must be CamelCase. No other options are available.\\nExamples:\\n lucky gen.email WelcomeUser\\n lucky gen.email SubscriptionRenewed\\n lucky gen.email ResetPassword\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

    The name of your task as derived by the class name Use the .task_name macro to define a custom task name

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.email\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

    By default, task summaries are optional.

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":36,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L36"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new Email\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":54,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L54"},"def":{"name":"call","visibility":"Public","body":"email_template.render(Path[\".\"])\ndisplay_success_messages\n"}},{"html_id":"email_name:String-instance-method","name":"email_name","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"email_name","return_type":"String","visibility":"Public","body":"if @email_name.nil?\n raise(\"email_name is required, but no value was passed.\")\nend\n@email_name.as(String)\n"}},{"html_id":"email_template-instance-method","name":"email_template","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L60"},"def":{"name":"email_template","visibility":"Public","body":"Carbon::EmailTemplate.new(filename, normalized_email_name)"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"set_opt_for_email_name(args:Array(String))-instance-method","name":"set_opt_for_email_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"set_opt_for_email_name","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\nmatches = value.is_a?(Array) ? value.all?(&.=~(/^[A-Z]/)) : value =~ (/^[A-Z]/)\nif !matches\n raise(\"Invalid format for email_name. It should match /^[A-Z]/\\n\\n\")\nend\n@email_name = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]}]},{"html_id":"carbon/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/string_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/string_extensions.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

    A String represents an immutable sequence of UTF-8 characters.

    ","instance_methods":[{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/string_extensions.cr#L6"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"Carbon::Address.new(address: self)"}}]}]}} \ No newline at end of file diff --git a/search-index.js b/search-index.js index 74b9303..2f5132b 100644 --- a/search-index.js +++ b/search-index.js @@ -1 +1 @@ -crystal_doc_search_index_callback({"repository_name":"carbon","body":"# Carbon\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Fcarbon%2F)](https://luckyframework.github.io/carbon)\n\nEmail library written in Crystal.\n\n![code preview](https://user-images.githubusercontent.com/22394/38457909-9f16f9fe-3a64-11e8-852c-74e31238f48b.png)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n carbon:\n github: luckyframework/carbon\n```\n\n## Adapters\n\n- `Carbon::SendGridAdapter`- See [luckyframework/carbon_sendgrid_adapter](https://github.com/luckyframework/carbon_sendgrid_adapter).\n- `Carbon::SmtpAdapter` - See [luckyframework/carbon_smtp_adapter](https://github.com/luckyframework/carbon_smtp_adapter).\n- `Carbon::AwsSesAdapter` - See [keizo3/carbon_aws_ses_adapter](https://github.com/keizo3/carbon_aws_ses_adapter).\n- `Carbon::SendInBlueAdapter` - See [atnos/carbon_send_in_blue_adapter](https://github.com/atnos/carbon_send_in_blue_adapter).\n- `Carbon::MailgunAdapter` - See [atnos/carbon_mailgun_adapter](https://github.com/atnos/carbon_mailgun_adapter).\n- `Carbon::SparkPostAdapter` - See [Swiss-Crystal/carbon_sparkpost_adapter](https://github.com/Swiss-Crystal/carbon_sparkpost_adapter).\n- `Carbon::PostmarkAdapter` - See [makisu/carbon_postmark_adapter](https://github.com/makisu/carbon_postmark_adapter).\n- `Carbon::MailersendAdapter` - See [balakhorvathnorbert/carbon_mailersend_adapter](https://github.com/balakhorvathnorbert/carbon_mailersend_adapter).\n\n## Usage\n\n### First, create a base class for your emails\n\n```crystal\nrequire \"carbon\"\n\n# You can setup defaults in this class\nabstract class BaseEmail < Carbon::Email\n # For example, set up a default 'from' address\n from Carbon::Address.new(\"My App Name\", \"support@myapp.com\")\n # Use a string if you just need the email address\n from \"support@myapp.com\"\nend\n```\n\n### Configure the mailer class\n\n```crystal\nBaseEmail.configure do |settings|\n settings.adapter = Carbon::DevAdapter.new(print_emails: true)\nend\n```\n\n### Create a class for your email\n\n```crystal\n# Create an email class\nclass WelcomeEmail < BaseEmail\n def initialize(@name : String, @email_address : String)\n end\n\n to @email_address\n subject \"Welcome, #{@name}!\"\n header \"My-Custom-Header\", \"header-value\"\n reply_to \"no-reply@noreply.com\"\n # You can also do just `text` or `html` if you don't want both\n templates text, html\nend\n```\n\n### Create templates\n\nTemplates go in the same folder the email is in:\n\n- Text email: `/templates//text.ecr`\n- HTML email: `/templates//html.ecr`\n\nSo if your email class is in `src/emails/welcome_email.cr`, then your\ntemplates would go in `src/emails/templates/welcome_email/text|html.ecr`.\n\n```\n# in /templates/welcome_email/text.ecr\n# Templates have access to instance variables and methods in the email.\nWelcome, <%= @name %>!\n```\n\n```\n# in /templates/welcome_email/html.ecr\n

    Welcome, <%= @name %>!

    \n```\n\nFor more information on what you can do with Embedded Crystal (ECR), see [the official Crystal documentation](https://crystal-lang.org/api/latest/ECR.html).\n\n### Template layouts\n\nLayouts are optional allowing you to specify how each email template looks individually.\nIf you'd like to have the same layout on each, you can create a layout template in\n`/templates//layout.ecr`\n\nIn this file, you'll yield the main email body with `<%= content %>`. Then in your `BaseEmail`, you can specify the name of the layout.\n\n```crystal\nabstract class BaseEmail < Carbon::Email\n macro inherited\n from default_from\n layout :application_layout\n end\nend\n```\n\n```\n# in src/emails/templates/application_layout/layout.ecr\n\n

    Our Email

    \n\n<%= content %>\n\n
    footer
    \n```\n\n### Deliver the email\n\n```\n# Send the email right away!\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver\n\n# Send the email in the background using `spawn`\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver_later\n```\n\n### Delay email delivery\n\nThe built-in delay uses the `deliver_later_strategy` setting set to `Carbon::SpawnStrategy`. You can create your own custom delayed strategy\nthat inherits from `Carbon::DeliverLaterStrategy` and defines a `run` method that takes a `Carbon::Email` and a block.\n\nOne example might be a job processor:\n\n```crystal\n# Define your new delayed strategy\nclass SendEmailInJobStrategy < Carbon::DeliverLaterStrategy\n\n # `block.call` will run `deliver`, but you can call\n # `deliver` yourself on the `email` when you need.\n def run(email : Carbon::Email, &block)\n EmailJob.perform_later(email)\n end\nend\n\nclass EmailJob < JobProcessor\n def perform(email : Carbon::Email)\n email.deliver\n end\nend\n\n# configure to use your new delayed strategy\nBaseEmail.configure do |settings|\n settings.deliver_later_strategy = SendEmailInJobStrategy.new\nend\n```\n\n## Testing\n\n### Change the adapter\n\n```crystal\n# In spec/spec_helper.cr or wherever you configure your code\nBaseEmail.configure do\n # This adapter will capture all emails in memory\n settings.adapter = Carbon::DevAdapter.new\nend\n```\n\n### Reset emails before each spec and include expectations\n\n```crystal\n# In spec/spec_helper.cr\n\n# This gives you the `be_delivered` expectation\ninclude Carbon::Expectations\n\nSpec.before_each do\n Carbon::DevAdapter.reset\nend\n```\n\n### Integration testing\n\n```crystal\n# Let's say we have a class that signs the user up and sends the welcome email\n# that was described at the beginning of the README\nclass SignUpUser\n def initialize(@name : String, @email_address : String)\n end\n\n def run\n sign_user_up\n WelcomeEmail.new(name: @name, email_address: @email_address).deliver\n end\nend\n\nit \"sends an email after the user signs up\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n # Test that this email was sent\n WelcomeEmail.new(name: \"Emily\", email_address: \"em@gmail.com\").should be_delivered\nend\n\n# or we can just check that some emails were sent\nit \"sends some emails\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n Carbon.should have_delivered_emails\nend\n```\n\n### Unit testing\n\nUnit testing is simple. Instantiate your email and test the fields you care about.\n\n```crystal\nit \"builds a nice welcome email\" do\n email = WelcomeEmail.new(name: \"David\", email_address: \"david@gmail.com\")\n # Note that recipients are converted to an array of Carbon::Address\n # So if you use a string value for the `to` field, you'll get an array of\n # Carbon::Address instead.\n email.to.should eq [Carbon::Address.new(\"david@gmail.com\")]\n email.text_body.should contain \"Welcome\"\n email.html_body.should contain \"Welcome\"\nend\n```\n\n> Note that unit testing can be superfluous in most cases. Instead, try\n> unit testing just fields that have complex logic. The compiler will catch most\n> other issues.\n\n## Development\n\n- `shards install`\n- Make changes\n- `./script/test`\n- `./bin/ameba`\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/carbon/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Make your changes\n4. Run `./script/test` to run the specs, build shards, and check formatting\n5. Commit your changes (git commit -am 'Add some feature')\n6. Push to the branch (git push origin my-new-feature)\n7. Create a new Pull Request\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator\n","program":{"html_id":"carbon/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"carbon","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Carbon","path":"Carbon.html","kind":"module","full_name":"Carbon","name":"Carbon","abstract":false,"locations":[{"filename":"src/carbon.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon.cr#L7"},{"filename":"src/carbon/attachment.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L1"},{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L1"},{"filename":"src/carbon/version.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/version.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"\"0.5.0\""}],"types":[{"html_id":"carbon/Carbon/Adapter","path":"Carbon/Adapter.html","kind":"class","full_name":"Carbon::Adapter","name":"Adapter","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/DevAdapter","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapter.cr#L2"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/Address","path":"Carbon/Address.html","kind":"class","full_name":"Carbon::Address","name":"Address","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/address.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(name:String,address:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(name : String, address : String)","args_html":"(name : String, address : String)","location":{"filename":"src/carbon/address.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(address:String)-class-method","name":"new","abstract":false,"args":[{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(address : String)","args_html":"(address : String)","location":{"filename":"src/carbon/address.cr","line_number":12,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L12"},"def":{"name":"new","args":[{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/address.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L7"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif name == other.name\nelse\n return false\nend\nif address == other.address\nelse\n return false\nend\ntrue\n"}},{"html_id":"address:String-instance-method","name":"address","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L6"},"def":{"name":"address","visibility":"Public","body":"@address"}},{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L18"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"self"}},{"html_id":"name:String?-instance-method","name":"name","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L6"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"to_s(io:IO)-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

    Appends a short String representation of this object which includes its class name and its object address.

    ","abstract":false,"args":[{"name":"io","external_name":"io","restriction":"IO"}],"args_string":"(io : IO)","args_html":"(io : IO)","location":{"filename":"src/carbon/address.cr","line_number":22,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L22"},"def":{"name":"to_s","args":[{"name":"io","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"io << to_s"}},{"html_id":"to_s:String-instance-method","name":"to_s","doc":"Returns a nicely readable and concise string representation of this object,\ntypically intended for users.\n\nThis method should usually **not** be overridden. It delegates to\n`#to_s(IO)` which can be overridden for custom implementations.\n\nAlso see `#inspect`.","summary":"

    Returns a nicely readable and concise string representation of this object, typically intended for users.

    ","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":26,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/address.cr#L26"},"def":{"name":"to_s","return_type":"String","visibility":"Public","body":"if @name\n \"\\\"#{@name}\\\" <#{@address}>\"\nelse\n @address\nend"}}]},{"html_id":"carbon/Carbon/AttachFile","path":"Carbon/AttachFile.html","kind":"alias","full_name":"Carbon::AttachFile","name":"AttachFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L2"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/AttachIO","path":"Carbon/AttachIO.html","kind":"alias","full_name":"Carbon::AttachIO","name":"AttachIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Attachment","path":"Carbon/Attachment.html","kind":"alias","full_name":"Carbon::Attachment","name":"Attachment","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil) | NamedTuple(io: IO, file_name: String, mime_type: String | Nil))","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Callbacks","path":"Carbon/Callbacks.html","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/carbon/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"macros":[{"html_id":"after_send(method_name)-macro","name":"after_send","doc":"Runs the given method after the adapter calls `deliver_now`.\nPasses in the return value of the adapter's `deliver_now` method.\n\n```\nafter_send :mark_email_as_sent\n\nprivate def mark_email_as_sent(response)\n # ...\nend\n```","summary":"

    Runs the given method after the adapter calls deliver_now.

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":46,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L46"},"def":{"name":"after_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_send do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_send(&block)-macro","name":"after_send","doc":"Runs the block after the adapter calls `deliver_now`, and passes the\nreturn value of the adapter's `deliver_now` method to the block.\n\n```\nafter_send do |response|\n # ...\nend\n```","summary":"

    Runs the block after the adapter calls deliver_now, and passes the return value of the adapter's deliver_now method to the block.

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L60"},"def":{"name":"after_send","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_send' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_send { |value| some_method(value) }\")\nend %}\n\n def after_send(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"before_send(method_name)-macro","name":"before_send","doc":"Runs the given method before the adapter calls `deliver_now`\n\n```\nbefore_send :attach_metadata\n\nprivate def attach_metadata\n # ...\nend\n```","summary":"

    Runs the given method before the adapter calls deliver_now

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L11"},"def":{"name":"before_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_send do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_send-macro","name":"before_send","doc":"Runs the block before the adapter calls `deliver_now`\n\n```\nbefore_send do\n # ...\nend\n```","summary":"

    Runs the block before the adapter calls deliver_now

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":24,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/callbacks.cr#L24"},"def":{"name":"before_send","visibility":"Public","body":" def before_send\n \n{% if @type.methods.map(&.name).includes?((:before_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"carbon/Carbon/DeliverLaterStrategy","path":"Carbon/DeliverLaterStrategy.html","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/deliver_later_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/deliver_later_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/SpawnStrategy","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email:Carbon::Email,&)-instance-method","name":"run","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email, &)","args_html":"(email : Carbon::Email, &)","location":{"filename":"src/carbon/deliver_later_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/deliver_later_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"yields":0,"block_arity":0,"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/DevAdapter","path":"Carbon/DevAdapter.html","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter","abstract":false,"superclass":{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},"ancestors":[{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"class_methods":[{"html_id":"delivered?(email):Bool-class-method","name":"delivered?","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email) : Bool","args_html":"(email) : Bool","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L15"},"def":{"name":"delivered?","args":[{"name":"email","external_name":"email","restriction":""}],"return_type":"Bool","visibility":"Public","body":"delivered_emails.any?(&.==(email))"}},{"html_id":"delivered_emails-class-method","name":"delivered_emails","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L2"},"def":{"name":"delivered_emails","visibility":"Public","body":"@@delivered_emails"}},{"html_id":"reset-class-method","name":"reset","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":19,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L19"},"def":{"name":"reset","visibility":"Public","body":"@@delivered_emails.clear"}}],"constructors":[{"html_id":"new(print_emails:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"args_string":"(print_emails : Bool = false)","args_html":"(print_emails : Bool = false)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L4"},"def":{"name":"new","args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(print_emails)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/adapters/dev_adapter.cr#L8"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":"@@delivered_emails << email\nif @print_emails\n print_email(email)\nend\n"}}]},{"html_id":"carbon/Carbon/Email","path":"Carbon/Email.html","kind":"class","full_name":"Carbon::Email","name":"Email","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/email.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/email.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L11"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif subject == other.subject\nelse\n return false\nend\nif from == other.from\nelse\n return false\nend\nif to == other.to\nelse\n return false\nend\nif cc == other.cc\nelse\n return false\nend\nif bcc == other.bcc\nelse\n return false\nend\nif headers == other.headers\nelse\n return false\nend\nif text_body == other.text_body\nelse\n return false\nend\nif html_body == other.html_body\nelse\n return false\nend\nif attachments == other.attachments\nelse\n return false\nend\ntrue\n"}},{"html_id":"after_send(result)-instance-method","name":"after_send","abstract":false,"args":[{"name":"result","external_name":"result","restriction":""}],"args_string":"(result)","args_html":"(result)","location":{"filename":"src/carbon/email.cr","line_number":35,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L35"},"def":{"name":"after_send","args":[{"name":"result","external_name":"result","restriction":""}],"visibility":"Public","body":""}},{"html_id":"attachments:Array({file_path:String,cid:String,file_name:String?,mime_type:String?}|{file_path:String,file_name:String?,mime_type:String?}|{io:IO,cid:String,file_name:String,mime_type:String?}|{io:IO,file_name:String,mime_type:String?})-instance-method","name":"attachments","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":95,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L95"},"def":{"name":"attachments","visibility":"Public","body":"@attachments"}},{"html_id":"bcc-instance-method","name":"bcc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":21,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L21"},"def":{"name":"bcc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"before_send-instance-method","name":"before_send","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L33"},"def":{"name":"before_send","visibility":"Public","body":""}},{"html_id":"cc-instance-method","name":"cc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":17,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L17"},"def":{"name":"cc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"deliver-instance-method","name":"deliver","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":145,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L145"},"def":{"name":"deliver","visibility":"Public","body":"before_send\nif deliverable?\n response = settings.adapter.deliver_now(self)\n after_send(response)\nend\n"}},{"html_id":"deliver_later-instance-method","name":"deliver_later","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":154,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L154"},"def":{"name":"deliver_later","visibility":"Public","body":"settings.deliver_later_strategy.run(self) do\n deliver\nend"}},{"html_id":"deliverable=(deliverable:Bool)-instance-method","name":"deliverable=","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"args_string":"(deliverable : Bool)","args_html":"(deliverable : Bool)","location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L15"},"def":{"name":"deliverable=","args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"visibility":"Public","body":"@deliverable = deliverable"}},{"html_id":"deliverable?:Bool-instance-method","name":"deliverable?","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L15"},"def":{"name":"deliverable?","return_type":"Bool","visibility":"Public","body":"@deliverable"}},{"html_id":"from:Carbon::Address-instance-method","name":"from","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L8"},"def":{"name":"from","return_type":"Carbon::Address","visibility":"Public","body":""}},{"html_id":"headers:Hash(String,String)-instance-method","name":"headers","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":37,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L37"},"def":{"name":"headers","visibility":"Public","body":"@headers"}},{"html_id":"html_body-instance-method","name":"html_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":29,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L29"},"def":{"name":"html_body","visibility":"Public","body":""}},{"html_id":"html_layout(content_io:IO)-instance-method","name":"html_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":31,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L31"},"def":{"name":"html_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"subject:String-instance-method","name":"subject","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L7"},"def":{"name":"subject","return_type":"String","visibility":"Public","body":""}},{"html_id":"text_body-instance-method","name":"text_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":25,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L25"},"def":{"name":"text_body","visibility":"Public","body":""}},{"html_id":"text_layout(content_io:IO)-instance-method","name":"text_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":27,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L27"},"def":{"name":"text_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"to:Array(Carbon::Address)-instance-method","name":"to","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":9,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L9"},"def":{"name":"to","return_type":"Array(Carbon::Address)","visibility":"Public","body":""}}],"macros":[{"html_id":"attachment(value)-macro","name":"attachment","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":97,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L97"},"def":{"name":"attachment","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def attachments : Array(Carbon::Attachment)\n \n{% if @type.methods.map(&.name).includes?(\"attachments\".id) %}\n previous_def\n {% end %}\n\n @attachments << \n{{ value }}\n\n \nend\n \n"}},{"html_id":"bcc(value)-macro","name":"bcc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"bcc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def bcc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"cc(value)-macro","name":"cc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"cc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def cc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"configure-macro","name":"configure","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":141,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L141"},"def":{"name":"configure","visibility":"Public","body":" \n{% raise(\"Make #{@type.name} abstract in order to configure it.\") %}\n\n \n"}},{"html_id":"from(value)-macro","name":"from","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":82,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L82"},"def":{"name":"from","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def from : Carbon::Address\n normalize(id_or_method(\n{{ value }}\n)).first\n \nend\n \n"}},{"html_id":"header(key,value)-macro","name":"header","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"args_string":"(key, value)","args_html":"(key, value)","location":{"filename":"src/carbon/email.cr","line_number":72,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L72"},"def":{"name":"header","args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def headers : Hash(String, String)\n \n{% if @type.methods.map(&.name).includes?((:headers).id) %}\n previous_def\n {% end %}\n\n @headers[\n{{ key }}\n] = \n{{ value }}\n\n @headers\n \nend\n \n"}},{"html_id":"id_or_method(value)-macro","name":"id_or_method","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":114,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L114"},"def":{"name":"id_or_method","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" \n{% if value.is_a?(SymbolLiteral) %}\n {{ value.id }}\n {% else %}\n {{ value }}\n {% end %}\n\n \n"}},{"html_id":"reply_to(address)-macro","name":"reply_to","abstract":false,"args":[{"name":"address","external_name":"address","restriction":""}],"args_string":"(address)","args_html":"(address)","location":{"filename":"src/carbon/email.cr","line_number":68,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L68"},"def":{"name":"reply_to","args":[{"name":"address","external_name":"address","restriction":""}],"visibility":"Public","body":" header \"Reply-To\", \n{{ address }}\n\n \n"}},{"html_id":"subject(value)-macro","name":"subject","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":88,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L88"},"def":{"name":"subject","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def subject : String\n id_or_method(\n{{ value }}\n)\n \nend\n \n"}},{"html_id":"to(value)-macro","name":"to","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":106,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L106"},"def":{"name":"to","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def to : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}}],"types":[{"html_id":"carbon/Carbon/Email/Recipients","path":"Carbon/Email/Recipients.html","kind":"alias","full_name":"Carbon::Email::Recipients","name":"Recipients","abstract":false,"locations":[{"filename":"src/carbon/email.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/email.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(Array(Carbon::Emailable) | Carbon::Emailable)","aliased_html":"Array(Carbon::Emailable) | Carbon::Emailable","const":false,"namespace":{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}}]},{"html_id":"carbon/Carbon/Emailable","path":"Carbon/Emailable.html","kind":"module","full_name":"Carbon::Emailable","name":"Emailable","abstract":false,"locations":[{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Address","kind":"class","full_name":"Carbon::Address","name":"Address"},{"html_id":"carbon/String","kind":"class","full_name":"String","name":"String"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"carbon_address:Carbon::Address-instance-method","name":"carbon_address","doc":"Adapter's should use this to get the Carbon::Address","summary":"

    Adapter's should use this to get the Carbon::Address

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L5"},"def":{"name":"carbon_address","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable)"}},{"html_id":"carbon_address_for_from:Carbon::Address-instance-method","name":"carbon_address_for_from","doc":"Adapter's should use this to get the Carbon::Address when used for 'from'","summary":"

    Adapter's should use this to get the Carbon::Address when used for 'from'

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/emailable.cr#L10"},"def":{"name":"carbon_address_for_from","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable_for_from)"}}]},{"html_id":"carbon/Carbon/EmailTemplate","path":"Carbon/EmailTemplate.html","kind":"class","full_name":"Carbon::EmailTemplate","name":"EmailTemplate","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(email_filename:String,email_class_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"args_string":"(email_filename : String, email_class_name : String)","args_html":"(email_filename : String, email_class_name : String)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L7"},"def":{"name":"new","args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(email_filename, email_class_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"render(path:Path)-instance-method","name":"render","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path"}],"args_string":"(path : Path)","args_html":"(path : Path)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L10"},"def":{"name":"render","args":[{"name":"path","external_name":"path","restriction":"Path"}],"visibility":"Public","body":"LuckyTemplate.write!(path, template_folder)"}},{"html_id":"template_folder-instance-method","name":"template_folder","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":14,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L14"},"def":{"name":"template_folder","visibility":"Public","body":"LuckyTemplate.create_folder do |top_dir|\n top_dir.add_folder(Path[\"src/emails/templates\"]) do |templates_dir|\n templates_dir.add_file(\"#{@email_filename}_email.cr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/email.cr.ecr\", io)\n end\n templates_dir.add_folder(\"#{@email_filename}_email\") do |email_templates_dir|\n email_templates_dir.add_file(\"html.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/html.ecr.ecr\", io)\n end\n email_templates_dir.add_file(\"text.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/text.ecr.ecr\", io)\n end\n end\n end\nend"}}]},{"html_id":"carbon/Carbon/Expectations","path":"Carbon/Expectations.html","kind":"module","full_name":"Carbon::Expectations","name":"Expectations","abstract":false,"locations":[{"filename":"src/carbon/expectations.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations.cr#L3"},{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"types":[{"html_id":"carbon/Carbon/Expectations/BeDeliveredExpectation","path":"Carbon/Expectations/BeDeliveredExpectation.html","kind":"struct","full_name":"Carbon::Expectations::BeDeliveredExpectation","name":"BeDeliveredExpectation","abstract":false,"superclass":{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"carbon/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"failure_message(email)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"String.build do |message|\n message << \"Expected: #{email} to be delivered\"\n if Carbon::DevAdapter.delivered_emails.empty?\n message << \", but no emails were delivered\"\n else\n message << \"\\n\\nTry this...\"\n message << \"\\n\\n ▸ See what emails were delivered with 'p Carbon::DevAdapter.delivered_emails'\"\n end\nend"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"match(email:Carbon::Email):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email) : Bool","args_html":"(email : Carbon::Email) : Bool","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"return_type":"Bool","visibility":"Public","body":"Carbon::DevAdapter.delivered?(email)"}},{"html_id":"negative_failure_message(email)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/be_delivered_expectation.cr#L18"},"def":{"name":"negative_failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"\"Expected: #{email} not to be delivered\""}}]},{"html_id":"carbon/Carbon/Expectations/HaveDeliveredEmailsExpectation","path":"Carbon/Expectations/HaveDeliveredEmailsExpectation.html","kind":"class","full_name":"Carbon::Expectations::HaveDeliveredEmailsExpectation","name":"HaveDeliveredEmailsExpectation","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"instance_methods":[{"html_id":"failure_message(_carbon:Carbon.class)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have delivered emails, but found none\""}},{"html_id":"match(_carbon:Carbon.class):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class) : Bool","args_html":"(_carbon : Carbon.class) : Bool","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"return_type":"Bool","visibility":"Public","body":"!Carbon::DevAdapter.delivered_emails.empty?"}},{"html_id":"negative_failure_message(_carbon:Carbon.class)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/expectations/have_delivered_emails_expectation.cr#L10"},"def":{"name":"negative_failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have no delivered emails, but found some\""}}]}]},{"html_id":"carbon/Carbon/ResourceFile","path":"Carbon/ResourceFile.html","kind":"alias","full_name":"Carbon::ResourceFile","name":"ResourceFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L4"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/ResourceIO","path":"Carbon/ResourceIO.html","kind":"alias","full_name":"Carbon::ResourceIO","name":"ResourceIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/attachment.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, cid: String, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/SpawnStrategy","path":"Carbon/SpawnStrategy.html","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy","abstract":false,"superclass":{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},"ancestors":[{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/spawn_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/spawn_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email,&block)-instance-method","name":"run","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email, &block)","args_html":"(email, &block)","location":{"filename":"src/carbon/spawn_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/spawn_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"spawn do\n block.call\nend"}}]}]},{"html_id":"carbon/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Gen/Email","path":"Gen/Email.html","kind":"class","full_name":"Gen::Email","name":"Email","abstract":false,"superclass":{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:email_name] of Symbol"}],"included_modules":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"carbon/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

    The help text to be displayed when a help flag is passed in (e.g.

    ","abstract":false,"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new email with html and text formats.\\nThe email name must be CamelCase. No other options are available.\\nExamples:\\n lucky gen.email WelcomeUser\\n lucky gen.email SubscriptionRenewed\\n lucky gen.email ResetPassword\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

    The name of your task as derived by the class name Use the .task_name macro to define a custom task name

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.email\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

    By default, task summaries are optional.

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":36,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L36"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new Email\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":54,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L54"},"def":{"name":"call","visibility":"Public","body":"email_template.render(Path[\".\"])\ndisplay_success_messages\n"}},{"html_id":"email_name:String-instance-method","name":"email_name","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"email_name","return_type":"String","visibility":"Public","body":"if @email_name.nil?\n raise(\"email_name is required, but no value was passed.\")\nend\n@email_name.as(String)\n"}},{"html_id":"email_template-instance-method","name":"email_template","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L60"},"def":{"name":"email_template","visibility":"Public","body":"Carbon::EmailTemplate.new(filename, normalized_email_name)"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"set_opt_for_email_name(args:Array(String))-instance-method","name":"set_opt_for_email_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"set_opt_for_email_name","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\nmatches = value.is_a?(Array) ? value.all?(&.=~(/^[A-Z]/)) : value =~ (/^[A-Z]/)\nif !matches\n raise(\"Invalid format for email_name. It should match /^[A-Z]/\\n\\n\")\nend\n@email_name = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]}]},{"html_id":"carbon/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/string_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/string_extensions.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

    A String represents an immutable sequence of UTF-8 characters.

    ","instance_methods":[{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/ea5e7e2c83bef2a67390a2ed4c311e637f13fce9/src/carbon/string_extensions.cr#L6"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"Carbon::Address.new(address: self)"}}]}]}}) \ No newline at end of file +crystal_doc_search_index_callback({"repository_name":"carbon","body":"# Carbon\n\n[![API Documentation Website](https://img.shields.io/website?down_color=red&down_message=Offline&label=API%20Documentation&up_message=Online&url=https%3A%2F%2Fluckyframework.github.io%2Fcarbon%2F)](https://luckyframework.github.io/carbon)\n\nEmail library written in Crystal.\n\n![code preview](https://user-images.githubusercontent.com/22394/38457909-9f16f9fe-3a64-11e8-852c-74e31238f48b.png)\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n carbon:\n github: luckyframework/carbon\n```\n\n## Adapters\n\n- `Carbon::SendGridAdapter`- See [luckyframework/carbon_sendgrid_adapter](https://github.com/luckyframework/carbon_sendgrid_adapter).\n- `Carbon::SmtpAdapter` - See [luckyframework/carbon_smtp_adapter](https://github.com/luckyframework/carbon_smtp_adapter).\n- `Carbon::AwsSesAdapter` - See [keizo3/carbon_aws_ses_adapter](https://github.com/keizo3/carbon_aws_ses_adapter).\n- `Carbon::SendInBlueAdapter` - See [atnos/carbon_send_in_blue_adapter](https://github.com/atnos/carbon_send_in_blue_adapter).\n- `Carbon::MailgunAdapter` - See [atnos/carbon_mailgun_adapter](https://github.com/atnos/carbon_mailgun_adapter).\n- `Carbon::SparkPostAdapter` - See [Swiss-Crystal/carbon_sparkpost_adapter](https://github.com/Swiss-Crystal/carbon_sparkpost_adapter).\n- `Carbon::PostmarkAdapter` - See [makisu/carbon_postmark_adapter](https://github.com/makisu/carbon_postmark_adapter).\n- `Carbon::MailersendAdapter` - See [balakhorvathnorbert/carbon_mailersend_adapter](https://github.com/balakhorvathnorbert/carbon_mailersend_adapter).\n\n## Usage\n\n### First, create a base class for your emails\n\n```crystal\nrequire \"carbon\"\n\n# You can setup defaults in this class\nabstract class BaseEmail < Carbon::Email\n # For example, set up a default 'from' address\n from Carbon::Address.new(\"My App Name\", \"support@myapp.com\")\n # Use a string if you just need the email address\n from \"support@myapp.com\"\nend\n```\n\n### Configure the mailer class\n\n```crystal\nBaseEmail.configure do |settings|\n settings.adapter = Carbon::DevAdapter.new(print_emails: true)\nend\n```\n\n### Create a class for your email\n\n```crystal\n# Create an email class\nclass WelcomeEmail < BaseEmail\n def initialize(@name : String, @email_address : String)\n end\n\n to @email_address\n subject \"Welcome, #{@name}!\"\n header \"My-Custom-Header\", \"header-value\"\n reply_to \"no-reply@noreply.com\"\n # You can also do just `text` or `html` if you don't want both\n templates text, html\nend\n```\n\n### Create templates\n\nTemplates go in the same folder the email is in:\n\n- Text email: `/templates//text.ecr`\n- HTML email: `/templates//html.ecr`\n\nSo if your email class is in `src/emails/welcome_email.cr`, then your\ntemplates would go in `src/emails/templates/welcome_email/text|html.ecr`.\n\n```\n# in /templates/welcome_email/text.ecr\n# Templates have access to instance variables and methods in the email.\nWelcome, <%= @name %>!\n```\n\n```\n# in /templates/welcome_email/html.ecr\n

    Welcome, <%= @name %>!

    \n```\n\nFor more information on what you can do with Embedded Crystal (ECR), see [the official Crystal documentation](https://crystal-lang.org/api/latest/ECR.html).\n\n### Template layouts\n\nLayouts are optional allowing you to specify how each email template looks individually.\nIf you'd like to have the same layout on each, you can create a layout template in\n`/templates//layout.ecr`\n\nIn this file, you'll yield the main email body with `<%= content %>`. Then in your `BaseEmail`, you can specify the name of the layout.\n\n```crystal\nabstract class BaseEmail < Carbon::Email\n macro inherited\n from default_from\n layout :application_layout\n end\nend\n```\n\n```\n# in src/emails/templates/application_layout/layout.ecr\n\n

    Our Email

    \n\n<%= content %>\n\n
    footer
    \n```\n\n### Deliver the email\n\n```\n# Send the email right away!\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver\n\n# Send the email in the background using `spawn`\nWelcomeEmail.new(\"Kate\", \"kate@example.com\").deliver_later\n```\n\n### Delay email delivery\n\nThe built-in delay uses the `deliver_later_strategy` setting set to `Carbon::SpawnStrategy`. You can create your own custom delayed strategy\nthat inherits from `Carbon::DeliverLaterStrategy` and defines a `run` method that takes a `Carbon::Email` and a block.\n\nOne example might be a job processor:\n\n```crystal\n# Define your new delayed strategy\nclass SendEmailInJobStrategy < Carbon::DeliverLaterStrategy\n\n # `block.call` will run `deliver`, but you can call\n # `deliver` yourself on the `email` when you need.\n def run(email : Carbon::Email, &block)\n EmailJob.perform_later(email)\n end\nend\n\nclass EmailJob < JobProcessor\n def perform(email : Carbon::Email)\n email.deliver\n end\nend\n\n# configure to use your new delayed strategy\nBaseEmail.configure do |settings|\n settings.deliver_later_strategy = SendEmailInJobStrategy.new\nend\n```\n\n## Testing\n\n### Change the adapter\n\n```crystal\n# In spec/spec_helper.cr or wherever you configure your code\nBaseEmail.configure do\n # This adapter will capture all emails in memory\n settings.adapter = Carbon::DevAdapter.new\nend\n```\n\n### Reset emails before each spec and include expectations\n\n```crystal\n# In spec/spec_helper.cr\n\n# This gives you the `be_delivered` expectation\ninclude Carbon::Expectations\n\nSpec.before_each do\n Carbon::DevAdapter.reset\nend\n```\n\n### Integration testing\n\n```crystal\n# Let's say we have a class that signs the user up and sends the welcome email\n# that was described at the beginning of the README\nclass SignUpUser\n def initialize(@name : String, @email_address : String)\n end\n\n def run\n sign_user_up\n WelcomeEmail.new(name: @name, email_address: @email_address).deliver\n end\nend\n\nit \"sends an email after the user signs up\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n # Test that this email was sent\n WelcomeEmail.new(name: \"Emily\", email_address: \"em@gmail.com\").should be_delivered\nend\n\n# or we can just check that some emails were sent\nit \"sends some emails\" do\n SignUpUser.new(name: \"Emily\", email_address: \"em@gmail.com\").run\n\n Carbon.should have_delivered_emails\nend\n```\n\n### Unit testing\n\nUnit testing is simple. Instantiate your email and test the fields you care about.\n\n```crystal\nit \"builds a nice welcome email\" do\n email = WelcomeEmail.new(name: \"David\", email_address: \"david@gmail.com\")\n # Note that recipients are converted to an array of Carbon::Address\n # So if you use a string value for the `to` field, you'll get an array of\n # Carbon::Address instead.\n email.to.should eq [Carbon::Address.new(\"david@gmail.com\")]\n email.text_body.should contain \"Welcome\"\n email.html_body.should contain \"Welcome\"\nend\n```\n\n> Note that unit testing can be superfluous in most cases. Instead, try\n> unit testing just fields that have complex logic. The compiler will catch most\n> other issues.\n\n## Development\n\n- `shards install`\n- Make changes\n- `./script/test`\n- `./bin/ameba`\n\n## Contributing\n\n1. Fork it ( https://github.com/luckyframework/carbon/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Make your changes\n4. Run `./script/test` to run the specs, build shards, and check formatting\n5. Commit your changes (git commit -am 'Add some feature')\n6. Push to the branch (git push origin my-new-feature)\n7. Create a new Pull Request\n\n## Contributors\n\n- [paulcsmith](https://github.com/paulcsmith) Paul Smith - creator\n","program":{"html_id":"carbon/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"carbon","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Carbon","path":"Carbon.html","kind":"module","full_name":"Carbon","name":"Carbon","abstract":false,"locations":[{"filename":"src/carbon.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon.cr#L7"},{"filename":"src/carbon/attachment.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L1"},{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L1"},{"filename":"src/carbon/version.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/version.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"\"0.5.0\""}],"types":[{"html_id":"carbon/Carbon/Adapter","path":"Carbon/Adapter.html","kind":"class","full_name":"Carbon::Adapter","name":"Adapter","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/DevAdapter","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapter.cr#L2"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/Address","path":"Carbon/Address.html","kind":"class","full_name":"Carbon::Address","name":"Address","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/address.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(name:String,address:String)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(name : String, address : String)","args_html":"(name : String, address : String)","location":{"filename":"src/carbon/address.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L15"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(address:String)-class-method","name":"new","abstract":false,"args":[{"name":"address","external_name":"address","restriction":"::String"}],"args_string":"(address : String)","args_html":"(address : String)","location":{"filename":"src/carbon/address.cr","line_number":12,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L12"},"def":{"name":"new","args":[{"name":"address","external_name":"address","restriction":"::String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/address.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L7"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif name == other.name\nelse\n return false\nend\nif address == other.address\nelse\n return false\nend\ntrue\n"}},{"html_id":"address:String-instance-method","name":"address","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L6"},"def":{"name":"address","visibility":"Public","body":"@address"}},{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L18"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"self"}},{"html_id":"name:String?-instance-method","name":"name","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L6"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"to_s(io:IO)-instance-method","name":"to_s","doc":"Appends a short String representation of this object\nwhich includes its class name and its object address.\n\n```\nclass Person\n def initialize(@name : String, @age : Int32)\n end\nend\n\nPerson.new(\"John\", 32).to_s # => #\n```","summary":"

    Appends a short String representation of this object which includes its class name and its object address.

    ","abstract":false,"args":[{"name":"io","external_name":"io","restriction":"IO"}],"args_string":"(io : IO)","args_html":"(io : IO)","location":{"filename":"src/carbon/address.cr","line_number":22,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L22"},"def":{"name":"to_s","args":[{"name":"io","external_name":"io","restriction":"IO"}],"visibility":"Public","body":"io << to_s"}},{"html_id":"to_s:String-instance-method","name":"to_s","doc":"Returns a nicely readable and concise string representation of this object,\ntypically intended for users.\n\nThis method should usually **not** be overridden. It delegates to\n`#to_s(IO)` which can be overridden for custom implementations.\n\nAlso see `#inspect`.","summary":"

    Returns a nicely readable and concise string representation of this object, typically intended for users.

    ","abstract":false,"location":{"filename":"src/carbon/address.cr","line_number":26,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/address.cr#L26"},"def":{"name":"to_s","return_type":"String","visibility":"Public","body":"if @name\n \"\\\"#{@name}\\\" <#{@address}>\"\nelse\n @address\nend"}}]},{"html_id":"carbon/Carbon/AttachFile","path":"Carbon/AttachFile.html","kind":"alias","full_name":"Carbon::AttachFile","name":"AttachFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L2"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/AttachIO","path":"Carbon/AttachIO.html","kind":"alias","full_name":"Carbon::AttachIO","name":"AttachIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Attachment","path":"Carbon/Attachment.html","kind":"alias","full_name":"Carbon::Attachment","name":"Attachment","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(file_path: String, file_name: String | Nil, mime_type: String | Nil) | NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil) | NamedTuple(io: IO, file_name: String, mime_type: String | Nil))","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?} | {file_path: String, file_name: String?, mime_type: String?} | {io: IO, cid: String, file_name: String, mime_type: String?} | {io: IO, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/Callbacks","path":"Carbon/Callbacks.html","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks","abstract":false,"locations":[{"filename":"src/carbon/callbacks.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"macros":[{"html_id":"after_send(method_name)-macro","name":"after_send","doc":"Runs the given method after the adapter calls `deliver_now`.\nPasses in the return value of the adapter's `deliver_now` method.\n\n```\nafter_send :mark_email_as_sent\n\nprivate def mark_email_as_sent(response)\n # ...\nend\n```","summary":"

    Runs the given method after the adapter calls deliver_now.

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":46,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L46"},"def":{"name":"after_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" after_send do |object|\n \n{{ method_name.id }}\n(object)\n \nend\n \n"}},{"html_id":"after_send(&block)-macro","name":"after_send","doc":"Runs the block after the adapter calls `deliver_now`, and passes the\nreturn value of the adapter's `deliver_now` method to the block.\n\n```\nafter_send do |response|\n # ...\nend\n```","summary":"

    Runs the block after the adapter calls deliver_now, and passes the return value of the adapter's deliver_now method to the block.

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L60"},"def":{"name":"after_send","block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":" \n{% if block.args.size != 1\n raise(\"The 'after_send' callback requires exactly 1 block arg to be passed.\\nExample:\\n after_send { |value| some_method(value) }\")\nend %}\n\n def after_send(\n%object\n)\n \n{% if @type.methods.map(&.name).includes?((:after_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ block.args.first }}\n = \n%object\n\n \n{{ block.body }}\n\n \nend\n \n"}},{"html_id":"before_send(method_name)-macro","name":"before_send","doc":"Runs the given method before the adapter calls `deliver_now`\n\n```\nbefore_send :attach_metadata\n\nprivate def attach_metadata\n # ...\nend\n```","summary":"

    Runs the given method before the adapter calls deliver_now

    ","abstract":false,"args":[{"name":"method_name","external_name":"method_name","restriction":""}],"args_string":"(method_name)","args_html":"(method_name)","location":{"filename":"src/carbon/callbacks.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L11"},"def":{"name":"before_send","args":[{"name":"method_name","external_name":"method_name","restriction":""}],"visibility":"Public","body":" before_send do\n \n{{ method_name.id }}\n\n \nend\n \n"}},{"html_id":"before_send-macro","name":"before_send","doc":"Runs the block before the adapter calls `deliver_now`\n\n```\nbefore_send do\n # ...\nend\n```","summary":"

    Runs the block before the adapter calls deliver_now

    ","abstract":false,"location":{"filename":"src/carbon/callbacks.cr","line_number":24,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/callbacks.cr#L24"},"def":{"name":"before_send","visibility":"Public","body":" def before_send\n \n{% if @type.methods.map(&.name).includes?((:before_send).id) %}\n previous_def\n {% else %}\n super\n {% end %}\n\n\n \n{{ yield }}\n\n \nend\n \n"}}]},{"html_id":"carbon/Carbon/DeliverLaterStrategy","path":"Carbon/DeliverLaterStrategy.html","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/deliver_later_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/deliver_later_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"carbon/Carbon/SpawnStrategy","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email:Carbon::Email,&)-instance-method","name":"run","abstract":true,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email, &)","args_html":"(email : Carbon::Email, &)","location":{"filename":"src/carbon/deliver_later_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/deliver_later_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"yields":0,"block_arity":0,"visibility":"Public","body":""}}]},{"html_id":"carbon/Carbon/DevAdapter","path":"Carbon/DevAdapter.html","kind":"class","full_name":"Carbon::DevAdapter","name":"DevAdapter","abstract":false,"superclass":{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},"ancestors":[{"html_id":"carbon/Carbon/Adapter","kind":"class","full_name":"Carbon::Adapter","name":"Adapter"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"class_methods":[{"html_id":"delivered?(email):Bool-class-method","name":"delivered?","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email) : Bool","args_html":"(email) : Bool","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L15"},"def":{"name":"delivered?","args":[{"name":"email","external_name":"email","restriction":""}],"return_type":"Bool","visibility":"Public","body":"delivered_emails.any?(&.==(email))"}},{"html_id":"delivered_emails-class-method","name":"delivered_emails","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L2"},"def":{"name":"delivered_emails","visibility":"Public","body":"@@delivered_emails"}},{"html_id":"reset-class-method","name":"reset","abstract":false,"location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":19,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L19"},"def":{"name":"reset","visibility":"Public","body":"@@delivered_emails.clear"}}],"constructors":[{"html_id":"new(print_emails:Bool=false)-class-method","name":"new","abstract":false,"args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"args_string":"(print_emails : Bool = false)","args_html":"(print_emails : Bool = false)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L4"},"def":{"name":"new","args":[{"name":"print_emails","default_value":"false","external_name":"print_emails","restriction":"::Bool"}],"visibility":"Public","body":"_ = allocate\n_.initialize(print_emails)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"deliver_now(email:Carbon::Email)-instance-method","name":"deliver_now","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email)","args_html":"(email : Carbon::Email)","location":{"filename":"src/carbon/adapters/dev_adapter.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/adapters/dev_adapter.cr#L8"},"def":{"name":"deliver_now","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"visibility":"Public","body":"@@delivered_emails << email\nif @print_emails\n print_email(email)\nend\n"}}]},{"html_id":"carbon/Carbon/Email","path":"Carbon/Email.html","kind":"class","full_name":"Carbon::Email","name":"Email","abstract":true,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/email.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Callbacks","kind":"module","full_name":"Carbon::Callbacks","name":"Callbacks"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"==(other:self)-instance-method","name":"==","doc":"Returns `true` if this reference is the same as *other*. Invokes `same?`.","summary":"

    Returns true if this reference is the same as other.

    ","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self"}],"args_string":"(other : self)","args_html":"(other : self)","location":{"filename":"src/carbon/email.cr","line_number":11,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L11"},"def":{"name":"==","args":[{"name":"other","external_name":"other","restriction":"self"}],"visibility":"Public","body":"if same?(other)\n return true\nend\nif subject == other.subject\nelse\n return false\nend\nif from == other.from\nelse\n return false\nend\nif to == other.to\nelse\n return false\nend\nif cc == other.cc\nelse\n return false\nend\nif bcc == other.bcc\nelse\n return false\nend\nif headers == other.headers\nelse\n return false\nend\nif text_body == other.text_body\nelse\n return false\nend\nif html_body == other.html_body\nelse\n return false\nend\nif attachments == other.attachments\nelse\n return false\nend\ntrue\n"}},{"html_id":"after_send(result)-instance-method","name":"after_send","abstract":false,"args":[{"name":"result","external_name":"result","restriction":""}],"args_string":"(result)","args_html":"(result)","location":{"filename":"src/carbon/email.cr","line_number":35,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L35"},"def":{"name":"after_send","args":[{"name":"result","external_name":"result","restriction":""}],"visibility":"Public","body":""}},{"html_id":"attachments-instance-method","name":"attachments","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":94,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L94"},"def":{"name":"attachments","visibility":"Public","body":"[] of Carbon::Attachment"}},{"html_id":"bcc-instance-method","name":"bcc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":21,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L21"},"def":{"name":"bcc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"before_send-instance-method","name":"before_send","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L33"},"def":{"name":"before_send","visibility":"Public","body":""}},{"html_id":"cc-instance-method","name":"cc","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":17,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L17"},"def":{"name":"cc","visibility":"Public","body":"[] of Carbon::Address"}},{"html_id":"deliver-instance-method","name":"deliver","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":147,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L147"},"def":{"name":"deliver","visibility":"Public","body":"before_send\nif deliverable?\n response = settings.adapter.deliver_now(self)\n after_send(response)\nend\n"}},{"html_id":"deliver_later-instance-method","name":"deliver_later","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":156,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L156"},"def":{"name":"deliver_later","visibility":"Public","body":"settings.deliver_later_strategy.run(self) do\n deliver\nend"}},{"html_id":"deliverable=(deliverable:Bool)-instance-method","name":"deliverable=","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"args_string":"(deliverable : Bool)","args_html":"(deliverable : Bool)","location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L15"},"def":{"name":"deliverable=","args":[{"name":"deliverable","external_name":"deliverable","restriction":"Bool"}],"visibility":"Public","body":"@deliverable = deliverable"}},{"html_id":"deliverable?:Bool-instance-method","name":"deliverable?","doc":"Set this value to `false` to prevent the email from\nbeing delivered","summary":"

    Set this value to false to prevent the email from being delivered

    ","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":15,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L15"},"def":{"name":"deliverable?","return_type":"Bool","visibility":"Public","body":"@deliverable"}},{"html_id":"from:Carbon::Address-instance-method","name":"from","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":8,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L8"},"def":{"name":"from","return_type":"Carbon::Address","visibility":"Public","body":""}},{"html_id":"headers:Hash(String,String)-instance-method","name":"headers","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":37,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L37"},"def":{"name":"headers","visibility":"Public","body":"@headers"}},{"html_id":"html_body-instance-method","name":"html_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":29,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L29"},"def":{"name":"html_body","visibility":"Public","body":""}},{"html_id":"html_layout(content_io:IO)-instance-method","name":"html_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":31,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L31"},"def":{"name":"html_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"subject:String-instance-method","name":"subject","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L7"},"def":{"name":"subject","return_type":"String","visibility":"Public","body":""}},{"html_id":"text_body-instance-method","name":"text_body","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":25,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L25"},"def":{"name":"text_body","visibility":"Public","body":""}},{"html_id":"text_layout(content_io:IO)-instance-method","name":"text_layout","abstract":false,"args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"args_string":"(content_io : IO)","args_html":"(content_io : IO)","location":{"filename":"src/carbon/email.cr","line_number":27,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L27"},"def":{"name":"text_layout","args":[{"name":"content_io","external_name":"content_io","restriction":"IO"}],"visibility":"Public","body":""}},{"html_id":"to:Array(Carbon::Address)-instance-method","name":"to","abstract":true,"location":{"filename":"src/carbon/email.cr","line_number":9,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L9"},"def":{"name":"to","return_type":"Array(Carbon::Address)","visibility":"Public","body":""}}],"macros":[{"html_id":"attachment(value)-macro","name":"attachment","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":98,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L98"},"def":{"name":"attachment","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def attachments : Array(Carbon::Attachment)\n \n{% if @type.methods.map(&.name).includes?((:attachments).id) %}\n previous_def | [{{ value }}]\n {% else %}\n super | [{{ value }}]\n {% end %}\n\n \nend\n \n"}},{"html_id":"bcc(value)-macro","name":"bcc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"bcc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def bcc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"cc(value)-macro","name":"cc","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"cc","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def cc : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}},{"html_id":"configure-macro","name":"configure","abstract":false,"location":{"filename":"src/carbon/email.cr","line_number":143,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L143"},"def":{"name":"configure","visibility":"Public","body":" \n{% raise(\"Make #{@type.name} abstract in order to configure it.\") %}\n\n \n"}},{"html_id":"from(value)-macro","name":"from","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":82,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L82"},"def":{"name":"from","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def from : Carbon::Address\n normalize(id_or_method(\n{{ value }}\n)).first\n \nend\n \n"}},{"html_id":"header(key,value)-macro","name":"header","abstract":false,"args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"args_string":"(key, value)","args_html":"(key, value)","location":{"filename":"src/carbon/email.cr","line_number":72,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L72"},"def":{"name":"header","args":[{"name":"key","external_name":"key","restriction":""},{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def headers : Hash(String, String)\n \n{% if @type.methods.map(&.name).includes?((:headers).id) %}\n previous_def\n {% end %}\n\n @headers[\n{{ key }}\n] = \n{{ value }}\n\n @headers\n \nend\n \n"}},{"html_id":"id_or_method(value)-macro","name":"id_or_method","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":116,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L116"},"def":{"name":"id_or_method","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" \n{% if value.is_a?(SymbolLiteral) %}\n {{ value.id }}\n {% else %}\n {{ value }}\n {% end %}\n\n \n"}},{"html_id":"reply_to(address)-macro","name":"reply_to","abstract":false,"args":[{"name":"address","external_name":"address","restriction":""}],"args_string":"(address)","args_html":"(address)","location":{"filename":"src/carbon/email.cr","line_number":68,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L68"},"def":{"name":"reply_to","args":[{"name":"address","external_name":"address","restriction":""}],"visibility":"Public","body":" header \"Reply-To\", \n{{ address }}\n\n \n"}},{"html_id":"subject(value)-macro","name":"subject","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":88,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L88"},"def":{"name":"subject","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def subject : String\n id_or_method(\n{{ value }}\n)\n \nend\n \n"}},{"html_id":"to(value)-macro","name":"to","abstract":false,"args":[{"name":"value","external_name":"value","restriction":""}],"args_string":"(value)","args_html":"(value)","location":{"filename":"src/carbon/email.cr","line_number":108,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L108"},"def":{"name":"to","args":[{"name":"value","external_name":"value","restriction":""}],"visibility":"Public","body":" def to : Array(Carbon::Address)\n normalize(id_or_method(\n{{ value }}\n))\n \nend\n \n"}}],"types":[{"html_id":"carbon/Carbon/Email/Recipients","path":"Carbon/Email/Recipients.html","kind":"alias","full_name":"Carbon::Email::Recipients","name":"Recipients","abstract":false,"locations":[{"filename":"src/carbon/email.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/email.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"(Array(Carbon::Emailable) | Carbon::Emailable)","aliased_html":"Array(Carbon::Emailable) | Carbon::Emailable","const":false,"namespace":{"html_id":"carbon/Carbon/Email","kind":"class","full_name":"Carbon::Email","name":"Email"}}]},{"html_id":"carbon/Carbon/Emailable","path":"Carbon/Emailable.html","kind":"module","full_name":"Carbon::Emailable","name":"Emailable","abstract":false,"locations":[{"filename":"src/carbon/emailable.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"carbon/Carbon/Address","kind":"class","full_name":"Carbon::Address","name":"Address"},{"html_id":"carbon/String","kind":"class","full_name":"String","name":"String"}],"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"carbon_address:Carbon::Address-instance-method","name":"carbon_address","doc":"Adapter's should use this to get the Carbon::Address","summary":"

    Adapter's should use this to get the Carbon::Address

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L5"},"def":{"name":"carbon_address","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable)"}},{"html_id":"carbon_address_for_from:Carbon::Address-instance-method","name":"carbon_address_for_from","doc":"Adapter's should use this to get the Carbon::Address when used for 'from'","summary":"

    Adapter's should use this to get the Carbon::Address when used for 'from'

    ","abstract":false,"location":{"filename":"src/carbon/emailable.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/emailable.cr#L10"},"def":{"name":"carbon_address_for_from","return_type":"Carbon::Address","visibility":"Public","body":"ensure_carbon_address(emailable_for_from)"}}]},{"html_id":"carbon/Carbon/EmailTemplate","path":"Carbon/EmailTemplate.html","kind":"class","full_name":"Carbon::EmailTemplate","name":"EmailTemplate","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L6"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"constructors":[{"html_id":"new(email_filename:String,email_class_name:String)-class-method","name":"new","abstract":false,"args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"args_string":"(email_filename : String, email_class_name : String)","args_html":"(email_filename : String, email_class_name : String)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":7,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L7"},"def":{"name":"new","args":[{"name":"email_filename","external_name":"email_filename","restriction":"String"},{"name":"email_class_name","external_name":"email_class_name","restriction":"String"}],"visibility":"Public","body":"_ = allocate\n_.initialize(email_filename, email_class_name)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"render(path:Path)-instance-method","name":"render","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path"}],"args_string":"(path : Path)","args_html":"(path : Path)","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L10"},"def":{"name":"render","args":[{"name":"path","external_name":"path","restriction":"Path"}],"visibility":"Public","body":"LuckyTemplate.write!(path, template_folder)"}},{"html_id":"template_folder-instance-method","name":"template_folder","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":14,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L14"},"def":{"name":"template_folder","visibility":"Public","body":"LuckyTemplate.create_folder do |top_dir|\n top_dir.add_folder(Path[\"src/emails/templates\"]) do |templates_dir|\n templates_dir.add_file(\"#{@email_filename}_email.cr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/email.cr.ecr\", io)\n end\n templates_dir.add_folder(\"#{@email_filename}_email\") do |email_templates_dir|\n email_templates_dir.add_file(\"html.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/html.ecr.ecr\", io)\n end\n email_templates_dir.add_file(\"text.ecr\") do |io|\n ECR.embed(\"/home/runner/work/carbon/carbon/src/carbon/tasks/gen/templates/text.ecr.ecr\", io)\n end\n end\n end\nend"}}]},{"html_id":"carbon/Carbon/Expectations","path":"Carbon/Expectations.html","kind":"module","full_name":"Carbon::Expectations","name":"Expectations","abstract":false,"locations":[{"filename":"src/carbon/expectations.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations.cr#L3"},{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"types":[{"html_id":"carbon/Carbon/Expectations/BeDeliveredExpectation","path":"Carbon/Expectations/BeDeliveredExpectation.html","kind":"struct","full_name":"Carbon::Expectations::BeDeliveredExpectation","name":"BeDeliveredExpectation","abstract":false,"superclass":{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"carbon/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"carbon/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"failure_message(email)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"String.build do |message|\n message << \"Expected: #{email} to be delivered\"\n if Carbon::DevAdapter.delivered_emails.empty?\n message << \", but no emails were delivered\"\n else\n message << \"\\n\\nTry this...\"\n message << \"\\n\\n ▸ See what emails were delivered with 'p Carbon::DevAdapter.delivered_emails'\"\n end\nend"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L1"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"match(email:Carbon::Email):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"args_string":"(email : Carbon::Email) : Bool","args_html":"(email : Carbon::Email) : Bool","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"email","external_name":"email","restriction":"Carbon::Email"}],"return_type":"Bool","visibility":"Public","body":"Carbon::DevAdapter.delivered?(email)"}},{"html_id":"negative_failure_message(email)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email)","args_html":"(email)","location":{"filename":"src/carbon/expectations/be_delivered_expectation.cr","line_number":18,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/be_delivered_expectation.cr#L18"},"def":{"name":"negative_failure_message","args":[{"name":"email","external_name":"email","restriction":""}],"visibility":"Public","body":"\"Expected: #{email} not to be delivered\""}}]},{"html_id":"carbon/Carbon/Expectations/HaveDeliveredEmailsExpectation","path":"Carbon/Expectations/HaveDeliveredEmailsExpectation.html","kind":"class","full_name":"Carbon::Expectations::HaveDeliveredEmailsExpectation","name":"HaveDeliveredEmailsExpectation","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon/Expectations","kind":"module","full_name":"Carbon::Expectations","name":"Expectations"},"instance_methods":[{"html_id":"failure_message(_carbon:Carbon.class)-instance-method","name":"failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L6"},"def":{"name":"failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have delivered emails, but found none\""}},{"html_id":"match(_carbon:Carbon.class):Bool-instance-method","name":"match","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class) : Bool","args_html":"(_carbon : Carbon.class) : Bool","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L2"},"def":{"name":"match","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"return_type":"Bool","visibility":"Public","body":"!Carbon::DevAdapter.delivered_emails.empty?"}},{"html_id":"negative_failure_message(_carbon:Carbon.class)-instance-method","name":"negative_failure_message","abstract":false,"args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"args_string":"(_carbon : Carbon.class)","args_html":"(_carbon : Carbon.class)","location":{"filename":"src/carbon/expectations/have_delivered_emails_expectation.cr","line_number":10,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/expectations/have_delivered_emails_expectation.cr#L10"},"def":{"name":"negative_failure_message","args":[{"name":"_carbon","external_name":"_carbon","restriction":"Carbon.class"}],"visibility":"Public","body":"\"Expected: Carbon to have no delivered emails, but found some\""}}]}]},{"html_id":"carbon/Carbon/ResourceFile","path":"Carbon/ResourceFile.html","kind":"alias","full_name":"Carbon::ResourceFile","name":"ResourceFile","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":4,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L4"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(file_path: String, cid: String, file_name: String | Nil, mime_type: String | Nil)","aliased_html":"{file_path: String, cid: String, file_name: String?, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/ResourceIO","path":"Carbon/ResourceIO.html","kind":"alias","full_name":"Carbon::ResourceIO","name":"ResourceIO","abstract":false,"locations":[{"filename":"src/carbon/attachment.cr","line_number":5,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/attachment.cr#L5"}],"repository_name":"carbon","program":false,"enum":false,"alias":true,"aliased":"NamedTuple(io: IO, cid: String, file_name: String, mime_type: String | Nil)","aliased_html":"{io: IO, cid: String, file_name: String, mime_type: String?}","const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"}},{"html_id":"carbon/Carbon/SpawnStrategy","path":"Carbon/SpawnStrategy.html","kind":"class","full_name":"Carbon::SpawnStrategy","name":"SpawnStrategy","abstract":false,"superclass":{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},"ancestors":[{"html_id":"carbon/Carbon/DeliverLaterStrategy","kind":"class","full_name":"Carbon::DeliverLaterStrategy","name":"DeliverLaterStrategy"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/spawn_strategy.cr","line_number":1,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/spawn_strategy.cr#L1"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"carbon/Carbon","kind":"module","full_name":"Carbon","name":"Carbon"},"instance_methods":[{"html_id":"run(email,&block)-instance-method","name":"run","abstract":false,"args":[{"name":"email","external_name":"email","restriction":""}],"args_string":"(email, &block)","args_html":"(email, &block)","location":{"filename":"src/carbon/spawn_strategy.cr","line_number":2,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/spawn_strategy.cr#L2"},"def":{"name":"run","args":[{"name":"email","external_name":"email","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"spawn do\n block.call\nend"}}]}]},{"html_id":"carbon/Gen","path":"Gen.html","kind":"module","full_name":"Gen","name":"Gen","abstract":false,"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"types":[{"html_id":"carbon/Gen/Email","path":"Gen/Email.html","kind":"class","full_name":"Gen::Email","name":"Email","abstract":false,"superclass":{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},"ancestors":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"},{"html_id":"carbon/LuckyTask/Task","kind":"class","full_name":"LuckyTask::Task","name":"Task"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"PARSER_OPTS","name":"PARSER_OPTS","value":"[:email_name] of Symbol"}],"included_modules":[{"html_id":"carbon/LuckyTask/TextHelpers","kind":"module","full_name":"LuckyTask::TextHelpers","name":"TextHelpers"}],"namespace":{"html_id":"carbon/Gen","kind":"module","full_name":"Gen","name":"Gen"},"class_methods":[{"html_id":"task_help_message:String-class-method","name":"task_help_message","doc":"The help text to be displayed when a help flag\nis passed in (e.g. -h, --help)\nUse the `help_message`","summary":"

    The help text to be displayed when a help flag is passed in (e.g.

    ","abstract":false,"def":{"name":"task_help_message","return_type":"String","visibility":"Public","body":"\"Generate a new email with html and text formats.\\nThe email name must be CamelCase. No other options are available.\\nExamples:\\n lucky gen.email WelcomeUser\\n lucky gen.email SubscriptionRenewed\\n lucky gen.email ResetPassword\""}},{"html_id":"task_name:String-class-method","name":"task_name","doc":"The name of your task as derived by the class name\nUse the `task_name` macro to define a custom task name","summary":"

    The name of your task as derived by the class name Use the .task_name macro to define a custom task name

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"task_name","return_type":"String","visibility":"Public","body":"\"gen.email\""}},{"html_id":"task_summary:String-class-method","name":"task_summary","doc":"By default, task summaries are optional.\nUse the `summary` macro to define a custom summary","summary":"

    By default, task summaries are optional.

    ","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":36,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L36"},"def":{"name":"task_summary","return_type":"String","visibility":"Public","body":"\"Generate a new Email\""}}],"instance_methods":[{"html_id":"call-instance-method","name":"call","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":54,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L54"},"def":{"name":"call","visibility":"Public","body":"email_template.render(Path[\".\"])\ndisplay_success_messages\n"}},{"html_id":"email_name:String-instance-method","name":"email_name","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"email_name","return_type":"String","visibility":"Public","body":"if @email_name.nil?\n raise(\"email_name is required, but no value was passed.\")\nend\n@email_name.as(String)\n"}},{"html_id":"email_template-instance-method","name":"email_template","abstract":false,"location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":60,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L60"},"def":{"name":"email_template","visibility":"Public","body":"Carbon::EmailTemplate.new(filename, normalized_email_name)"}},{"html_id":"option_parser:OptionParser-instance-method","name":"option_parser","abstract":false,"def":{"name":"option_parser","return_type":"OptionParser","visibility":"Public","body":"@option_parser"}},{"html_id":"option_parser=(option_parser:OptionParser)-instance-method","name":"option_parser=","abstract":false,"args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"args_string":"(option_parser : OptionParser)","args_html":"(option_parser : OptionParser)","def":{"name":"option_parser=","args":[{"name":"option_parser","external_name":"option_parser","restriction":"OptionParser"}],"visibility":"Public","body":"@option_parser = option_parser"}},{"html_id":"output:IO-instance-method","name":"output","abstract":false,"def":{"name":"output","return_type":"IO","visibility":"Public","body":"@output"}},{"html_id":"output=(output:IO)-instance-method","name":"output=","abstract":false,"args":[{"name":"output","external_name":"output","restriction":"IO"}],"args_string":"(output : IO)","args_html":"(output : IO)","def":{"name":"output=","args":[{"name":"output","external_name":"output","restriction":"IO"}],"visibility":"Public","body":"@output = output"}},{"html_id":"print_help_or_call(args:Array(String))-instance-method","name":"print_help_or_call","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":33,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L33"},"def":{"name":"print_help_or_call","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"if wants_help_message?(args)\n output.puts(self.class.task_help_message)\nelse\n {% for opt in @type.constant(:PARSER_OPTS) %}\n set_opt_for_{{ opt.id }}(args)\n {% end %}\n option_parser.parse(args)\n call\nend"}},{"html_id":"set_opt_for_email_name(args:Array(String))-instance-method","name":"set_opt_for_email_name","abstract":false,"args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"args_string":"(args : Array(String))","args_html":"(args : Array(String))","location":{"filename":"src/carbon/tasks/gen/email.cr","line_number":52,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/tasks/gen/email.cr#L52"},"def":{"name":"set_opt_for_email_name","args":[{"name":"args","external_name":"args","restriction":"Array(String)"}],"visibility":"Public","body":"value = args[@positional_arg_count]?\nmatches = value.is_a?(Array) ? value.all?(&.=~(/^[A-Z]/)) : value =~ (/^[A-Z]/)\nif !matches\n raise(\"Invalid format for email_name. It should match /^[A-Z]/\\n\\n\")\nend\n@email_name = value\n@positional_arg_count = @positional_arg_count + 1\n"}}]}]},{"html_id":"carbon/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"carbon/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"carbon/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/carbon/string_extensions.cr","line_number":3,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/string_extensions.cr#L3"}],"repository_name":"carbon","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"carbon/Carbon/Emailable","kind":"module","full_name":"Carbon::Emailable","name":"Emailable"},{"html_id":"carbon/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nA string might end up being composed of bytes which form an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but every\nbyte that doesn't start a valid UTF-8 byte sequence is interpreted as though\nit encodes the Unicode replacement character (U+FFFD) by itself. For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.\n\nNote that this interpretation only applies to methods inside Crystal; calling\n`#to_slice` or `#to_unsafe`, e.g. when passing a string to a C library, will\nexpose the invalid UTF-8 byte sequences. In particular, `Regex`'s underlying\nengine may reject strings that are not valid UTF-8, or it may invoke undefined\nbehavior on invalid strings. If this is undesired, `#scrub` could be used to\nremove the offending byte sequences first.","summary":"

    A String represents an immutable sequence of UTF-8 characters.

    ","instance_methods":[{"html_id":"emailable:Carbon::Address-instance-method","name":"emailable","abstract":false,"location":{"filename":"src/carbon/string_extensions.cr","line_number":6,"url":"https://github.com/luckyframework/carbon/blob/55d2838f1a87a82bc93d011065881dd87cdec96a/src/carbon/string_extensions.cr#L6"},"def":{"name":"emailable","return_type":"Carbon::Address","visibility":"Public","body":"Carbon::Address.new(address: self)"}}]}]}}) \ No newline at end of file