Commit f1f5863b authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Stan Hu
Browse files

Add an endpoint to get the Bitbucket user profile

parent 8cd306ff0691
......@@ -4,6 +4,11 @@ def initialize(options = {})
@connection = options.fetch(:connection, Connection.new(options))
end
def user
parsed_response = connection.get('/user')
Representation::User.new(parsed_response)
end
private
attr_reader :connection
......
module Bitbucket
module Representation
class Base
def initialize(raw)
@raw = raw
end
private
attr_reader :raw
end
end
end
module Bitbucket
module Representation
class User < Representation::Base
def username
raw['username']
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment