Class: DropboxApi::Metadata::MediaInfo

Inherits:
Base
  • Object
show all
Defined in:
lib/dropbox_api/metadata/media_info.rb

Overview

Example of a serialized MediaInfo object:

{
  ".tag": "metadata",
  "metadata": {...}
}

or:

{
  ".tag": "pending"
}

Class Method Summary collapse

Methods inherited from Base

field, #initialize, #serialized_field, #to_hash

Constructor Details

This class inherits a constructor from DropboxApi::Metadata::Base

Class Method Details

.new(data) ⇒ Object


20
21
22
23
24
25
26
27
28
# File 'lib/dropbox_api/metadata/media_info.rb', line 20

def new(data)
  klass = class_for(data['.tag'].to_sym)

  if klass == :pending
    :pending
  else
    klass.new(data['metadata'])
  end
end