 
     request url, fn
 
+  # Create alias for each type of posts and forward this call to @posts method
   alias = (self, type) ->
     self[type] = (options, fn) ->
       options = {} if not options
       options.type = type if not options.type
       @posts options, fn
 
+  # Alias text, quote, link, answer, video, audio and photo posts
   alias @, type for type in ['text', 'quote', 'link', 'answer', 'video', 'audio', 'photo']
 
+  # Prepare url for API call
   urlFor = (action, self, options = null) ->
     params = [
       'http://api.tumblr.com/v2/blog/'         # Tumblr API URL

##
# Tumblr API
##

xhr = require 'request'
qs  = require 'querystring'

Tumblr = exports.Tumblr = (host, key) ->
  @host = host
  @key  = key

(->

  @info = (fn) ->
    url = urlFor 'info', @

    request url, fn

  @posts = (options, fn) ->
    [fn, options] = [options, null] if typeof options is 'function'



    params.join ''

  # Request API and call callback function with response
  request = (url, fn = ->) ->
    xhr {url}, (error, request, body) ->
      body = JSON.parse body
