Jesus / dropbox_api

Ruby client library for Dropbox API v2
MIT License
171 stars 113 forks source link

Add media_info field to DropboxApi::Metadata::File #28

Closed mendab1e closed 7 years ago

mendab1e commented 7 years ago

The list_folder request of Dropbox API allows to pass include_media_info param. In case if it is equal to true, API also includes media_info in response. Currently DropboxApi::Client#list_folder#entries doesn't have media_info field.

In this PR support for the media_info field has been added to DropboxApi::Metadata::File.

mendab1e commented 7 years ago

@Jesus I've extracted media_info to the separate class. The documentation says that it's a union for PhotoMetadata and VideoMetadata, so I decided to implement it as a factory for these classes.

mendab1e commented 7 years ago

@Jesus ping.

Jesus commented 7 years ago

Sorry for the delay. I'll try to merge this over the weekend.

Jesus commented 7 years ago

Hi there,

I've updated the tests just for a couple of reasons:

  1. Enhance coverage.
  2. Trying to be consistent with the rest of the suite and, as much as possible, following Thoughtbot's style: https://github.com/thoughtbot/guides/tree/dee16052f49cb4b41fb8d090ffdb75942512ddb1/style#testing

I hope you don't mind.

Jesus commented 7 years ago

This has been published in the last version of the gem: 0.1.9

mendab1e commented 7 years ago

Awesome, thanks.