Class: DropboxApi::Results::SaveUrlJobStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/dropbox_api/results/save_url_job_status.rb

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Class Method Details

.new(result_data) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/dropbox_api/results/save_url_job_status.rb', line 3

def self.new(result_data)
  case result_data[".tag"]
  when "in_progress"
    :in_progress
  when "complete"
    DropboxApi::Metadata::File.new result_data
  when "failed"
    DropboxApi::Errors::SaveUrlError.build("Async job failed",
                                           result_data["failed"])
  else
    raise NotImplementedError, "Unknown result type: #{result_data[".tag"]}"
  end
end