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
6391cde28f41
Commit
4d7303a9
authored
Nov 18, 2016
by
Stan Hu
Browse files
Clean up owner and slug representation
parent
a78cbbeb4ba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/bitbucket/representation/repo.rb
View file @
6391cde2
...
...
@@ -5,10 +5,18 @@ class Repo < Representation::Base
def
initialize
(
raw
)
super
(
raw
)
end
if
full_name
&&
full_name
.
split
(
'/'
).
size
==
2
@owner
,
@slug
=
full_name
.
split
(
'/'
)
end
def
owner_and_slug
@owner_and_slug
||=
full_name
.
split
(
'/'
,
2
)
end
def
owner
owner_and_slug
.
first
end
def
slug
owner_and_slug
.
last
end
def
clone_url
(
token
=
nil
)
...
...
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