Sha256: e4207ec764c32c78d1a0faa3dbb89444988c0346d9e134a8d0660133c04e829f

Contents?: true

Size: 769 Bytes

Versions: 12

Compression:

Stored size: 769 Bytes

Contents

module Zype
  # This class does not support all, create, update or delete methods.
  # Read more at https://docs.zype.com/v1.0/reference#players
  #
  # @since 0.10.0
  class Players < Zype::BaseModel
    %i[all create update delete].each do |mtd|
      send(:define_method, mtd) do
        raise NoMethodError
      end
    end

    # Retrieve formatted player responses
    #
    # @param id [String] ID of the video
    # @param format [String] format to return the response in. Valid options are html, js, json
    # @return [Hash|String]
    def find(id:, format:)
      client.execute(method: :get, path: "/#{path}/#{id}.#{format}")
    end

    private

    def path
      @path = 'embed'
    end

    def client_class
      Zype::PlayerClient
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zype-0.20.0 lib/zype/models/players.rb
zype-0.19.0 lib/zype/models/players.rb
zype-0.18.0 lib/zype/models/players.rb
zype-0.17.0 lib/zype/models/players.rb
zype-0.16.1 lib/zype/models/players.rb
zype-0.16.0 lib/zype/models/players.rb
zype-0.15.0 lib/zype/models/players.rb
zype-0.14.0 lib/zype/models/players.rb
zype-0.13.0 lib/zype/models/players.rb
zype-0.12.0 lib/zype/models/players.rb
zype-0.11.0 lib/zype/models/players.rb
zype-0.10.0 lib/zype/models/players.rb