Class: Episodic::Platform::Upload

Inherits:
Object
  • Object
show all
Defined in:
lib/episodic/platform/write_methods.rb

Overview

Represents a pending upload. This includes the URL, filename as well as a list of params to be included in the POST.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(upload) ⇒ Upload

Constructor

Parameters

upload<Hash>

A hash for an upload element in the response.



434
435
436
437
438
439
440
441
# File 'lib/episodic/platform/write_methods.rb', line 434

def initialize(upload)
  @filename = upload["filename"]
  @url = upload["url"]
  @params = {}
  upload["param"].each do |param|
    @params[param["name"]] = param["content"]
  end
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



425
426
427
# File 'lib/episodic/platform/write_methods.rb', line 425

def filename
  @filename
end

#paramsObject (readonly)

Returns the value of attribute params.



425
426
427
# File 'lib/episodic/platform/write_methods.rb', line 425

def params
  @params
end

#urlObject (readonly)

Returns the value of attribute url.



425
426
427
# File 'lib/episodic/platform/write_methods.rb', line 425

def url
  @url
end