Class: Vzaar::Request::LinkUpload

Inherits:
Base
  • Object
show all
Defined in:
lib/vzaar/request/link_upload.rb

Instance Attribute Summary

Attributes inherited from Base

#conn, #opts

Instance Method Summary collapse

Methods inherited from Base

endpoint, #execute, format, resource

Methods included from Helper

#blank?, #hash_to_xml, #symb_keys

Instance Method Details

#json_bodyObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/vzaar/request/link_upload.rb', line 15

def json_body
  { "vzaar-api" => {
      link_upload: {
        key: options[:key],
        guid: options[:guid],
        url: CGI.escape(options.fetch(:url, "")),
        encoding_params: {
          title: sanitize_str(options[:title]),
          description: sanitize_str(options[:description]),
          size_id: options[:profile],
          bitrate: options[:bitrate],
          width: options[:width],
          replace_id: options[:replace_id],
          transcoding: options[:transcoding]
        }
      }
    }
  }
end

#xml_bodyObject



9
10
11
12
13
# File 'lib/vzaar/request/link_upload.rb', line 9

def xml_body
  <<-XML
    <?xml version="1.0" encoding="UTF-8"?>#{hash_to_xml(json_body)}
  XML
end