Skip to content

Commit

Permalink
Merge pull request #60 from mahemoff/readme-unwrap
Browse files Browse the repository at this point in the history
document "unwrap" option in README
  • Loading branch information
tjarratt committed Mar 4, 2016
2 parents 92ac042 + 6371ceb commit 484debd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ Gyoku.xml("XML" => "key")
* These conventions are also applied to the return value of objects responding to :call
* All other objects are converted to Strings using :to_s

## Array values

Array items are by default wrapped with the containiner tag, which may be unexpected.

``` ruby
> Gyoku.xml({languages: [{language: 'ruby'},{language: 'java'}]})
# => "<languages><language>ruby</language></languages><languages><language>java</language></languages>"
```

You can set the `unwrap` option to remove this behavior.

``` ruby
> Gyoku.xml({languages: [{language: 'ruby'},{language: 'java'}]}, { unwrap: true})
# => "<languages><language>ruby</language><language>java</language></languages>"
```

## Special characters

Expand Down

0 comments on commit 484debd

Please sign in to comment.