Sha256: 2279fa3302edb8ecf9be0dd6cf320344422a6efa958e79841f9ab2556ce01c83

Contents?: true

Size: 570 Bytes

Versions: 1

Compression:

Stored size: 570 Bytes

Contents

module Iremix
  class Video
    attr_accessor :id, :title, :video_url, :person_id, :screenshot_url,
                  :description, :tags, :group_id, :created_at, :updated_at

    def initialize(attrs = {})
      attrs.each do |k, v| send("#{k}=", v) end
    end

    class << self
      def all(token)
        response = token.get('/api/v1/videos.json', :params => { :access_token => token.token })
        videos = []

        response.parsed['videos'].each do |video_attrs|
          videos << new(video_attrs)
        end

        videos
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iremix-ruby-0.0.5 lib/iremix/video.rb