github/api: move `html_url` to GithubEntity since it's shared by all of them
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 3 Feb 2015 21:25:41 +0000 (22:25 +0100)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 3 Feb 2015 21:25:41 +0000 (22:25 +0100)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/github/api.nit

index ba8943e..25f17a9 100644 (file)
@@ -344,6 +344,9 @@ abstract class GithubEntity
        end
 
        redef fun to_s do return json.to_json
+
+       # Github page url.
+       fun html_url: String do return json["html_url"].to_s
 end
 
 # A Github user.
@@ -365,9 +368,6 @@ class User
                self.json = json
        end
 
-       # Github User page url.
-       fun html_url: String do return json["html_url"].to_s
-
        # Avatar image url for this user.
        fun avatar_url: String do return json["avatar_url"].to_s
 end
@@ -394,9 +394,6 @@ class Repo
        # Repo short name on Github.
        fun name: String do return json["name"].to_s
 
-       # Github User page url.
-       fun html_url: String do return json["html_url"].to_s
-
        # Get the repo owner.
        fun owner: User do
                return new User.from_json(api, json["owner"].as(JsonObject))