Sha256: 5f656f27cb29ff32c0afd577ee09e96bca43a91ecbb37b25a8c5af7db064e7ff

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module Skydrive
  # A user's video in SkyDrive.
  class Video < Skydrive::File
    # The link that can be used to download the video file
    # @return [String]
    def download_link
      url = client.get("/#{id}/content", :download => true, :suppress_redirects => true)["location"]
    end

    # Download the video file
    def download
      uri = URI(download_link)
      response = HTTParty.get("http://#{uri.host}#{uri.path}?#{uri.query}")
      response.parsed_response
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
skydrive-0.1.4 lib/skydrive/video.rb
skydrive-0.1.0 lib/skydrive/video.rb
skydrive-0.0.2 lib/skydrive/video.rb