Created
January 28, 2014 16:51
-
-
Save mbejda/8671545 to your computer and use it in GitHub Desktop.
API Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var call = { | |
object: 'accounts', | |
method: 'get', | |
action: 'allInfluencers' | |
} | |
var accountObject = function () { | |
var self = this; | |
self.allInfluencers = function () { | |
console.log('YES') | |
} | |
return { | |
allInfluencers: self.allInfluencers | |
} | |
} | |
var getApi = function () { | |
return { | |
accounts: new accountObject(), | |
} | |
} | |
var apiObject = function () { | |
var self = this; | |
return { | |
get: new getApi(), | |
} | |
} | |
var api = new apiObject(); | |
api.get.accounts.allInfluencers(); | |
api[call.method][call.object][call.action] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment