Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down