Skip to content

how exactly this cron parser is working here? #82

Answered by maennchen
siddhant3030 asked this question in Q&A
Discussion options

You must be logged in to vote

This is using a feature called sigils. You can find details about it here: https://elixir-lang.org/getting-started/sigils.html

Basically crontab is registering a sigil when you import it: https://github.com/jshmrtn/crontab/blob/f42a90a1ab227c9137bd9f31d33ccfb1a82439e2/lib/crontab/cron_expression.ex#L140

When using inspect, there is a custom protocol that also displays it as a sigil, since it is better to read than the Crontab.CronExpression struct.: https://github.com/jshmrtn/crontab/blob/f42a90a1ab227c9137bd9f31d33ccfb1a82439e2/lib/crontab/cron_expression.ex#L186

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@siddhant3030
Comment options

Answer selected by maennchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #81 on August 10, 2021 08:01.