Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8ac128bf600a
Commit
f1f5863b
authored
Aug 22, 2016
by
Douglas Barbosa Alexandre
Committed by
Stan Hu
Nov 21, 2016
Browse files
Add an endpoint to get the Bitbucket user profile
parent
8cd306ff0691
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/bitbucket/client.rb
View file @
8ac128bf
...
...
@@ -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
...
...
lib/bitbucket/representation/base.rb
0 → 100644
View file @
8ac128bf
module
Bitbucket
module
Representation
class
Base
def
initialize
(
raw
)
@raw
=
raw
end
private
attr_reader
:raw
end
end
end
lib/bitbucket/representation/user.rb
0 → 100644
View file @
8ac128bf
module
Bitbucket
module
Representation
class
User
<
Representation
::
Base
def
username
raw
[
'username'
]
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment