module Millicast
  class Base < ActiveResource::Base
    self.site = 'https://api.millicast.com/api'
    self.connection.auth_type = :bearer
    self.connection.bearer_token = ENV.fetch("MILLICAST_API_SECRET")
    self.include_format_in_path = false

    def self.enable_logging
      ActiveSupport::Notifications.subscribe('request.active_resource')  do |name, start, finish, id, payload|
        puts payload
      end
    end
  end
end
