module Bcx
  class Client < Rapidash::Client
    extension :json

    resource :projects, class_name: 'Bcx::Resources::Project'
    resource :todolists, class_name: 'Bcx::Resources::Todolist'

    def initialize(auth_method, options = {})
      @account = Bcx.configuration.account
      @api_version = Bcx.configuration.api_version

      self.class.site("https://basecamp.com/#{@account}/api/#{@api_version}/")
      self.class.method(auth_method)

      super(options)
    end

  end
end

module Bcx
  class Client < Rapidash::Client
    extension :json

    raise_errors
    # Add error handling with Faraday
    # https://github.com/pengwynn/octokit/blob/master/lib/octokit/error.rb
    # https://github.com/pengwynn/octokit/blob/master/spec/helper.rb

    resource :projects, class_name: 'Bcx::Resources::Project'
    resource :todolists, class_name: 'Bcx::Resources::Todolist'

    def initialize(auth_method, options = {})
      @account = Bcx.configuration.account
      @api_version = Bcx.configuration.api_version

      self.class.site("https://basecamp.com/#{@account}/api/#{@api_version}/")
      self.class.method(auth_method)

      super(options)
    end

  end
end

Raise error on failure. Add notes about error handling
Raise error on failure. Add notes about error handling