Class: DropboxApi::ConnectionBuilder
- Inherits:
-
Object
- Object
- DropboxApi::ConnectionBuilder
- Defined in:
- lib/dropbox_api/connection_builder.rb
Instance Method Summary collapse
- #build(url) ⇒ Object
-
#initialize(oauth_bearer) ⇒ ConnectionBuilder
constructor
A new instance of ConnectionBuilder.
- #middleware ⇒ Object
Constructor Details
#initialize(oauth_bearer) ⇒ ConnectionBuilder
Returns a new instance of ConnectionBuilder
3 4 5 |
# File 'lib/dropbox_api/connection_builder.rb', line 3 def initialize(oauth_bearer) @oauth_bearer = oauth_bearer end |
Instance Method Details
#build(url) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/dropbox_api/connection_builder.rb', line 11 def build(url) Faraday.new(url) do |connection| middleware.apply(connection) do connection. :Bearer, @oauth_bearer yield connection end end end |
#middleware ⇒ Object
7 8 9 |
# File 'lib/dropbox_api/connection_builder.rb', line 7 def middleware @middleware ||= MiddleWare::Stack.new end |