Module: Tinybucket::Connection
- Included in:
- Api::BaseApi
- Defined in:
- lib/tinybucket/connection.rb
Constant Summary collapse
- DEFAULT_USER_AGENT =
'Tinybucket Ruby Bitbucket REST client'.freeze
Instance Method Summary collapse
Instance Method Details
#caching? ⇒ Boolean
11 12 13 |
# File 'lib/tinybucket/connection.rb', line 11 def caching? !@connection.nil? end |
#clear_cache ⇒ Object
7 8 9 |
# File 'lib/tinybucket/connection.rb', line 7 def clear_cache @connection = nil end |
#connection(parser = nil, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/tinybucket/connection.rb', line 15 def connection(parser = nil, = {}) = () clear_cache # TODO: cache connection for each (options, parser) pairs. Faraday.new( .merge(builder: stack(parser, )) ) end |