summaryrefslogtreecommitdiff
path: root/lib/bitbucket
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bitbucket')
-rw-r--r--lib/bitbucket/representation/repo.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/bitbucket/representation/repo.rb b/lib/bitbucket/representation/repo.rb
index fe5cda66ab9..b291dfe0441 100644
--- a/lib/bitbucket/representation/repo.rb
+++ b/lib/bitbucket/representation/repo.rb
@@ -5,10 +5,18 @@ module Bitbucket
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)