Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Jan 25, 2014
1 parent e1a0448 commit fe0c1bb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
12 changes: 12 additions & 0 deletions src/coffee/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ ProductService = require('./services/products')
###
class SphereClient

###*
* Constructs a new client with given API credentials
* @constructor
*
* @param {Object} config An object containing the credentials for the `sphere-node-connect`
* {@link https://github.com/emmenko/sphere-node-connect#documentation}
###
constructor: (config)->
###*
* @private
* Instance of the Rest client
* @type {Rest}
###
@_rest = new Rest config

# services
Expand Down
12 changes: 9 additions & 3 deletions src/coffee/services/base.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ class BaseService

###*
* Initialize the class.
* @param {Rest} [_rest] an instance of the Rest client (sphere-node-connect)
* @return {BaseService}
* @constructor
*
* @param {Rest} [_rest] An instance of the Rest client (sphere-node-connect)
###
constructor: (@_rest)->
###*
* @private
* Base path for a API resource endpoint (to be overriden by specific service)
* @type {String}
###
@_projectEndpoint = '/'

###*
* Fetch resource defined by [_projectEndpoint]
* @return {Promise} a promise, fulfilled with an Object or rejected with a SphereError
* @return {Promise} A promise, fulfilled with an Object or rejected with a SphereError
###
fetch: ->
deferred = Q.defer()
Expand Down
12 changes: 9 additions & 3 deletions src/coffee/services/products.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ class ProductService extends BaseService

###*
* Initialize the class.
* @param {Rest} [_rest] an instance of the Rest client (sphere-node-connect)
* @return {ProductService}
* @constructor
*
* @param {Rest} [_rest] An instance of the Rest client `sphere-node-connect`
###
constructor: (rest)->
super(rest)
@_projectEndpoint = '/'
###*
* @private
* Base path for Products endpoint.
* @type {String}
###
@_projectEndpoint = '/products'

###*
* The {@link ProductService} service.
Expand Down

1 comment on commit fe0c1bb

@svenmueller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Please sign in to comment.