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

Add an endpoint to get the Bitbucket user profile

parent fc34c956
...@@ -4,6 +4,11 @@ module Bitbucket ...@@ -4,6 +4,11 @@ module Bitbucket
@connection = options.fetch(:connection, Connection.new(options)) @connection = options.fetch(:connection, Connection.new(options))
end end
def user
parsed_response = connection.get('/user')
Representation::User.new(parsed_response)
end
private private
attr_reader :connection 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