Class: DropboxApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dropbox_api/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oauth_bearer = ENV["DROPBOX_OAUTH_BEARER"]) ⇒ Client

Returns a new instance of Client.



3
4
5
# File 'lib/dropbox_api/client.rb', line 3

def initialize(oauth_bearer = ENV["DROPBOX_OAUTH_BEARER"])
  @connection_builder = ConnectionBuilder.new(oauth_bearer)
end

Class Method Details

.add_endpoint(name, endpoint) ⇒ Object



7
8
9
10
11
# File 'lib/dropbox_api/client.rb', line 7

def self.add_endpoint(name, endpoint)
  define_method(name) do |*args, &block|
    endpoint.new(@connection_builder).send(name, *args, &block)
  end
end