Commit 4d7303a9 authored by Stan Hu's avatar Stan Hu

Clean up owner and slug representation

parent 9e6b25d0
...@@ -5,10 +5,18 @@ module Bitbucket ...@@ -5,10 +5,18 @@ module Bitbucket
def initialize(raw) def initialize(raw)
super(raw) super(raw)
end
if full_name && full_name.split('/').size == 2 def owner_and_slug
@owner, @slug = full_name.split('/') @owner_and_slug ||= full_name.split('/', 2)
end end
def owner
owner_and_slug.first
end
def slug
owner_and_slug.last
end end
def clone_url(token = nil) def clone_url(token = nil)
......
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