Class: Bitbucket::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bitbucket/configuration.rb

Constant Summary collapse

@@oauth_options =
{:signature_method=>"HMAC-SHA1",
:request_token_path=>"/api/1.0/oauth/request_token",
:authorize_path=>"/api/1.0/oauth/authenticate",
:access_token_path=>"/api/1.0/oauth/access_token",
:proxy=>nil,
# :proxy=>"http://localhost:8080/",
:scheme=>:header,
:http_method=>:post,
:oauth_version=>"1.0",
:site=>"https://bitbucket.org"}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#consumer_keyObject

Returns the value of attribute consumer_key.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def consumer_key
  @consumer_key
end

#consumer_secretObject

Returns the value of attribute consumer_secret.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def consumer_secret
  @consumer_secret
end

#passwordObject

Returns the value of attribute password.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def password
  @password
end

#secretObject

Returns the value of attribute secret.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def secret
  @secret
end

#tokenObject

Returns the value of attribute token.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def token
  @token
end

#usernameObject

Returns the value of attribute username.



30
31
32
# File 'lib/bitbucket/configuration.rb', line 30

def username
  @username
end

Class Method Details

.oauth_optionsObject



18
19
20
# File 'lib/bitbucket/configuration.rb', line 18

def self.oauth_options
  @@oauth_options
end

Instance Method Details

#oauth_consumerObject



22
23
24
25
26
27
28
# File 'lib/bitbucket/configuration.rb', line 22

def oauth_consumer
  @oauth_consumer ||= OAuth::Consumer.new(
    self.consumer_key,
    self.consumer_secret,
    @@oauth_options
  )
end