Skip to content

Commit

Permalink
clarify integer coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Oct 19, 2016
1 parent 0651e3c commit 0e4a400
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,10 @@ IntegerInteraction.run!(limit: 10)
# => [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
```

When a `String` is passed into an `integer` input, the value will coerced. However, you may want to specify the `base` for the conversion to something more sensible (e.g. `base: 10`).
When a `String` is passed into an `integer` input, the value will be coerced.
Coercion is based on `Kernel#Integer` which attempts to detect the base being used.
However, you may want to specify the `base` for the conversion to something more
sensible (e.g. `base: 10`).

``` rb
class IntegerInteraction < ActiveInteraction::Base
Expand Down

0 comments on commit 0e4a400

Please sign in to comment.