Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
prodis committed Nov 5, 2017
1 parent 76339b5 commit da2d9e0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ $ gem install wannabe_bool

`to_b` method is available on `String`, `Symbol`, `Numeric`, `TrueClass`, `FalseClass` and `NilClass`.

For sake of readability (and personal choice), `to_b` has two aliases:
- `to_bool`
- `to_boolean`

Given this example:
```ruby
{
one: 'value',
two: 2,
mobile?: params[:mobile].to_b
}
```

It could be "more readable" like this:
```ruby
{
one: 'value',
two: 2,
mobile?: params[:mobile].to_boolean
}
```

Don't forget to require the gem:
```ruby
require 'wannabe_bool'
```
Expand Down

0 comments on commit da2d9e0

Please sign in to comment.