Sha256: a18590f86cd928221c1428e5e77b0798810b0f1300c8cdcbe4197b15921c595f

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

module Bitmovin::Encoding::Manifests
  class List
    include Bitmovin::Helpers

    class << self
      def init(path, klass)
        @resource_path = path
        @klass = klass
      end
      attr_reader :resource_path
      attr_reader :klass
    end

    attr_accessor :manifest_id
    def initialize(manifest_id)
      @manifest_id = manifest_id
    end

    def list(limit = 100, offset = 0)
      path = File.join("/v1/encoding/manifest/", @manifest_id, self.class.resource_path)
      response = Bitmovin.client.get(path, { limit: limit, offset: offset })
      result(response)['items'].map { |item| self.class.klass.new(@encoding_id, item) }
    end

    def add(stream)
      raise "Not implemented yet. Please use #build and Stream#save! for the time being"
    end

    def build(hash = {})
      self.class.klass.new(@manifest_id, hash)
    end

    def find(id)
      path = File.join("/v1/encoding/manifests/", @manifest_id, self.class.resource_path, id)
      response = Bitmovin.client.get(path)
      self.class.klass.new(@manifest_id, result(response))
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bitmovin-ruby-0.9.1 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.9.0 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.8.1 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.8.0 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.7.0 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.5.0 lib/bitmovin/encoding/manifests/list.rb
bitmovin-ruby-0.4.0 lib/bitmovin/encoding/manifests/list.rb