Class: Vzaar::Request::EditVideo

Inherits:
Video
  • Object
show all
Defined in:
lib/vzaar/request/edit_video.rb

Instance Attribute Summary

Attributes inherited from Base

#conn, #opts

Instance Method Summary collapse

Methods inherited from Video

#video_id

Methods inherited from Base

endpoint, #execute, format, resource

Methods included from Helper

#blank?, #hash_to_xml, #symb_keys

Instance Method Details

#get_optsObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vzaar/request/edit_video.rb', line 22

def get_opts
  { "vzaar-api" => {
      "video" => {
        "title" => sanitize_str(options[:title]),
        "seo_url" => CGI.escape(options.fetch(:seo_url, "")),
        "description" => sanitize_str(options[:description]),
        "private" => options[:private]
      }
    }
  }
end

#json_bodyObject

JC: duplicated, refactor



9
10
11
# File 'lib/vzaar/request/edit_video.rb', line 9

def json_body
  get_opts.to_json
end

#xml_bodyObject



13
14
15
16
17
18
19
20
# File 'lib/vzaar/request/edit_video.rb', line 13

def xml_body
  request_xml = %{
    <?xml version="1.0" encoding="UTF-8"?>
    #{hash_to_xml(get_opts)}
  }

  request_xml
end