Class: Bitbucket::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/bitbucket/connection.rb

Constant Summary collapse

DEFAULT_API_VERSION =
'2.0'
DEFAULT_BASE_URI =
'https://api.bitbucket.org/'
DEFAULT_QUERY =
{}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Connection

Returns a new instance of Connection.



13
14
15
# File 'lib/bitbucket/connection.rb', line 13

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/bitbucket/connection.rb', line 9

def options
  @options
end

Instance Method Details

#connectionObject



17
18
19
20
21
22
23
# File 'lib/bitbucket/connection.rb', line 17

def connection
  @connection ||= if app_password_connection?
                    Bitbucket::AppPasswordConnection.new(options)
                  else
                    Bitbucket::OauthConnection.new(options)
                  end
end