diff --git a/Gemfile.lock b/Gemfile.lock index 8b117b6..ac41a73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - decanter (4.0.2) + decanter (4.0.3) actionpack (>= 4.2.10) activesupport rails-html-sanitizer (>= 1.0.4) diff --git a/README.md b/README.md index 6b3a042..d102ea1 100644 --- a/README.md +++ b/README.md @@ -137,11 +137,19 @@ input :ids, :array, parse_each: :integer ### Parser options -Parsers can receive options that modify their behavior. These options are passed in as named arguments to `input`: +Some parsers can receive options that modify their behavior. These options are passed in as named arguments to `input`: + +**Example:** ```ruby input :start_date, :date, parse_format: '%Y-%m-%d' ``` +**Available Options:** +| Parser | Option | Default | Notes +| ----------- | ----------- | -----------| ----------- +| `ArrayParser` | `parse_each`| N/A | Accepts a parser type, then uses that parser to parse each element in the array. If this option is not defined, each element is simply returned. +| `DateParser`| `parse_format` | `'%m/%d/%Y'`| Accepts any format string accepted by Ruby's `strftime` method +| `DateTimeParser` | `parse_format` | `'%m/%d/%Y %I:%M:%S %p'` | Accepts any format string accepted by Ruby's `strftime` method ### Exceptions diff --git a/lib/decanter/version.rb b/lib/decanter/version.rb index 764056d..5ffaffd 100644 --- a/lib/decanter/version.rb +++ b/lib/decanter/version.rb @@ -1,3 +1,3 @@ module Decanter - VERSION = '4.0.2'.freeze + VERSION = '4.0.3'.freeze end