Skip to content

Commit 4db13fe

Browse files
docs: Add YAML format example and API reference link to README (#266)
1 parent 6ad32d3 commit 4db13fe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ To validate that the domain is not on the deny list (under config/deny_listed_em
8989
validates :email, 'valid_email_2/email': { deny_list: true }
9090
```
9191

92+
The allow_listed_email_domains.yml and deny_listed_email_domains.yml can be written as follows:
93+
94+
```yml
95+
# config/deny_listed_email_domains.yml
96+
- denied1.example.com
97+
- denied2.example.com
98+
```
99+
92100
To validate that email is not subaddressed:
93101
```ruby
94102
validates :email, 'valid_email_2/email': { disallow_subaddressing: true }
@@ -117,6 +125,7 @@ validates :email, 'valid_email_2/email': { mx: true, disposable: true, disallow_
117125
> Note that this gem will let an empty email pass through so you will need to
118126
> add `presence: true` if you require an email
119127

128+
120129
### Use without ActiveModel
121130

122131
```ruby
@@ -128,6 +137,8 @@ address.valid_strict_mx? => true
128137
address.subaddressed? => false
129138
```
130139

140+
For other APIs, please check [lib/valid_email2/address.rb](https://github.com/micke/valid_email2/blob/main/lib/valid_email2/address.rb).
141+
131142
If you want to allow multibyte characters, set it explicitly.
132143

133144
```ruby

0 commit comments

Comments
 (0)