From 03d2daf1c360ddc3560a769a0c80bedef0c16174 Mon Sep 17 00:00:00 2001 From: usernamealreadyis Date: Sun, 13 Mar 2016 16:07:24 +0700 Subject: [PATCH] README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retrieve the value of the given property from the “parent” of the context class. If that value is a function, then invoke it with the additional args and retrieve the return value of that call instead. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 6243120..a2829b1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ This document outlines the setup and usage of ZenHub's public API: a RESTful API ## Authentication All requests to the API need an API token. Generate a token in the [Settings](https://dashboard.zenhub.io/#/settings) section of your ZenHub Dashboard. +```json +getSuper = (property, args...) -> + result = @constructor.__super__[property] + + if _.isFunction(result) then result.apply(@, args) else result +``` + + Note: Each user may only have one token, so generating a new token will make any previous tokens invalid. The token is sent in the `X-Authentication-Token` header. For example, using `curl` it'd be `curl -H 'X-Authentication-Token: TOKEN' URL`. Alternatively, you can send the token in the URL using the `access_token` query string attribute. To do so, add ```?access_token=TOKEN``` to any url.