Sha256: a0df5e51b68cc1398a4523b87fb2f57bf5ce6609a17c8ed18a4546d69c8c42a2

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 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
  cast Float, :duration
  cast URI, :thumbnail_url
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hooloo-0.2.0 lib/hooloo/video.rb