Skip to content

Commit

Permalink
Add NEWS about JSON imports and exports
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwil committed Jul 11, 2024
1 parent d23dc26 commit d3f4285
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
Unreleased

Add `Import#json`, `Export#json`, and `Export#email` (#34).

The `#json` interface for importing and exporting JSON have been designed to work the same way they already work for the CSV interfaces. For example:

```ruby
json_string = [
{
email: "george@vandelay_industries.com",
password: "bosco"
}
].to_json

result = ArtVandelay::Import.new(:users).json(json_string, attributes: {email_address: :email, passcode: :password})
```

`ArtVandelay::Export#email_csv` has been changed to a more-generic `ArtVandelay::Export#email` method that takes a new `:format` option. The new option defaults to `:csv` but can also be used with `:json`. Since the old `#email_csv` method no longer exists, you'll need to update your application code accordingly. For example:

```diff
-ArtVandelay::Export.email_csv(to: my_email_address)
+ArtVandelay::Export.email(to: my_email_address)
```

*Benjamin Wil*

0.2.0 (June 15, 2023)

Add option that allows stripping of whitespace for all values (#19)
Expand Down

0 comments on commit d3f4285

Please sign in to comment.