Sha256: 760b7065dd7159e3bb75e9fce340fe8ca5bf0d351ff1869fe78c2878bc6a1017

Contents?: true

Size: 636 Bytes

Versions: 4

Compression:

Stored size: 636 Bytes

Contents

class Hooloo::Video < Hooloo::MozartHash
  # @param id [Fixnum]
  def initialize(id)
    super
    if id.is_a? Fixnum
      @obj = Hooloo.request("videos/#{id}")['data'][0]['video']
    end
  end
  def oembed
    Hooloo.request '/api/oembed.json', url: "http://www.hulu.com/watch/#{@obj['id']}"
  end
  def copyright
    @obj['copyright'].split(',').map(&:strip)
  end
  date :available_at, :cache_time, :original_premiere_date, :released_at
  bool :embed_permitted, :has_captions, :has_hd, :is_auth_valid, :is_expiring, :is_html5_enabled,
       :is_mature, :is_subscriber_only, :is_web_only
  float :duration
  uri :thumbnail_url
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hooloo-0.3.2 lib/hooloo/video.rb
hooloo-0.3.1 lib/hooloo/video.rb
hooloo-0.3.0 lib/hooloo/video.rb
hooloo-0.2.1 lib/hooloo/video.rb