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

Clean up owner and slug representation

parent a78cbbeb4ba1
......@@ -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)
......
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