Sha256: 38f4a784d96ffda4e49391e21f8af1bea14ef3a09ca3445ab87151b00648b88e

Contents?: true

Size: 828 Bytes

Versions: 8

Compression:

Stored size: 828 Bytes

Contents

module Bitmovin
  class Client
    attr_accessor :api_key
    attr_accessor :base_url

    def initialize(config)
      @api_key = config[:api_key]
      @base_url = "https://api.bitmovin.com/v1"
      @conn = Faraday.new(url: @base_url, headers: {
          'X-Api-Key' => @api_key,
          'X-Api-Client-Version' => Bitmovin::VERSION,
          'X-Api-Client' => 'bitmovin-ruby',
          'Content-Type' => 'application/json'
        }) do |faraday|

        faraday.request :json
        #faraday.response :logger
        faraday.adapter :httpclient
        faraday.response :raise_error
      end
    end

    def get(*args, &block)
      @conn.get *args, &block
    end

    def delete(*args, &block)
      @conn.delete *args, &block
    end

    def post(*args, &block)
      @conn.post *args, &block
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bitmovin-ruby-0.8.0 lib/bitmovin/client.rb
bitmovin-ruby-0.7.0 lib/bitmovin/client.rb
bitmovin-ruby-0.5.0 lib/bitmovin/client.rb
bitmovin-ruby-0.4.0 lib/bitmovin/client.rb
bitmovin-ruby-0.3.0 lib/bitmovin/client.rb
bitmovin-ruby-0.2.0 lib/bitmovin/client.rb
bitmovin-ruby-0.1.1 lib/bitmovin/client.rb
bitmovin-ruby-0.1.0 lib/bitmovin/client.rb