README.md in bootic_client-0.0.13 vs README.md in bootic_client-0.0.14
- old
+ new
@@ -163,10 +163,21 @@
puts product.rels[:web].href # => 'http://acme.bootic.net/products/a-shiny-new-product'
end
```
+### Working with Files and IO instances
+
+Instances of `File` and other readable `IO` objects will be base64-encoded internally before JSON-encoding payloads for `POST`, `PUT` and `PATCH` requests.
+
+```ruby
+asset = product.create_product_asset(
+ filename: 'foo.jpg',
+ data: File.new('/path/to/foo.jpg') # this will base64-encode the file data in the `data` field.
+)
+```
+
## Relation docs
All resource link relations include a "docs" URL so you can learn more about that particular resource.
```ruby
@@ -185,10 +196,10 @@
...
c.cache_store = Rails.cache
end
```
-Outside of Rails, BooticClient ships with a wrapper around the [Dalli](https://github.com/mperham/dalli) memcache client.
+Outside of Rails, BooticClient ships with a wrapper around the [Dalli](https://github.com/mperham/dalli) memcache client.
You must include Dalli in your Gemfile and require the wrapper explicitely.
```ruby
require 'bootic_client/stores/memcache'
CACHE_STORE = BooticClient::Stores::Memcache.new(ENV['MEMCACHE_SERVER'])