Skip to content

Commit

Permalink
updates ruby symbol syntax in README.md
Browse files Browse the repository at this point in the history
Hello,

First of all, I would like to express my gratitude to creator of this gem. It is very helpful.

I would like readme to be updated with a new symbol syntax, in my opinion it looks better. Experience developers, who maintain legacy systems will be able to read new one, but fresh rubyists will copy and paste this code without thinking. I don't care about gem source code, because users don't see it, but in readme we should see examples with updated syntax.

Thank you!
  • Loading branch information
raventid committed Sep 16, 2015
1 parent ef9c091 commit 2ba2c51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -17,21 +17,21 @@ bundle install
Then add the following to your model:

```ruby
validates :my_email_attribute, :email => true
validates :my_email_attribute, email: true
```

## Strict mode

In order to have stricter validation (according to http://www.remote.org/jochen/mail/info/chars.html) enable strict mode. You can do this globally by adding the following to your Gemfile:

```ruby
gem 'email_validator', :require => 'email_validator/strict'
gem 'email_validator', require: 'email_validator/strict'
```

Or you can do this in a specific `validates` call:

```ruby
validates :my_email_attribute, :email => {:strict_mode => true}
validates :my_email_attribute, email: {strict_mode: true}
```

## Validation outside a model
Expand All @@ -48,7 +48,7 @@ EmailValidator.valid?('narf@example.com') # boolean
### Strict mode

```ruby
EmailValidator.regexp(:strict_mode => true)
EmailValidator.regexp(strict_mode: true)
```

## Thread safety
Expand Down

0 comments on commit 2ba2c51

Please sign in to comment.