 
   build_default_attachments: (msg, query) ->
 
-    fallback    = []
-    at          = {}
-    at['color'] = @color
-    at['text']  = msg
+    fallback = []
+    at       = {}
+    at.text  = msg
 
-    if query['pretext']
-      fallback.push(query['pretext'])
+    if query.color
+      color = query.color
+    else
+      color = @color
+
+    at.color = color
+
+    if query.pretext
+      fallback.push(query.pretext)
+
+    if query.title
+      fallback.push(query.title)
+
+    if query.title_link
+      fallback.push(query.title_link)
+
+    fallback.push(msg)
+    at.fallback = fallback.join(' - ')
+
+    at.mrkdwn_in = ['text', 'pretext']
+
+    if query.pretext
+      at.pretext = query.pretext
 
     if query['title']
-      fallback.push(query['title'])
+      at.title = query.title
 
-    if query['title_link']
-      fallback.push(query['title_link'])
+    if query.title_link
+      at.title_link = query.title_link
 
-    fallback.push(msg)
-    at['fallback'] = fallback.join(' - ')
+    if query.author_name
+      at.author_name = query.author_name
 
-    at['mrkdwn_in'] = ['text', 'pretext']
+    if query.author_link
+      at.author_link = query.author_link
 
-    if query['pretext']
-      at['pretext'] = query['pretext']
+    if query.author_icon
+      at.author_icon = query.author_icon
 
-    if query['title']
-      at['title'] = query['title']
+    if query.image_url
+      at.image_url = query.image_url
 
-    if query['title_link']
-      at['title_link'] = query['title_link']
+    if query.thumb_url
+      at.thumb_url = query.thumb_url
 
-    if query['author_name']
-      at['author_name'] = query['author_name']
+    if query.fields
+      at.fields = query.fields
 
-    if query['author_link']
-      at['author_link'] = query['author_link']
-
-    if query['author_icon']
-      at['author_icon'] = query['author_icon']
-
-    if query['image_url']
-      at['image_url'] = query['image_url']
-
-    if query['thumb_url']
-      at['thumb_url'] = query['thumb_url']
-
-    if query['fields']
-      at['fields'] = query['fields']
-
-    if query['mrkdwn']
-      at['mrkdwn'] = query['mrkdwn']
+    if query.mrkdwn
+      at.mrkdwn = query.mrkdwn
     else
-      at['mrkdwn'] = true
+      at.mrkdwn = true
 
     if @debug
       console.log "at: %j", JSON.stringify({ 'attachments': [ at ] })


    super(robot)

    @fmtLabel    = 'payload'
    @color       = '#aaaaaa'
    @token       = process.env.HUBOT_SLACK_TOKEN
    @uri         = 'https://slack.com/api/chat.postMessage'
    @debug       = process.env.HUBOT_SLACK_DEBUG

  bold: (str) ->
    ' *' + str + '* '

      color = @color

    for cs in commits
      text     = []
      fallback = []
      cstr     = cs.message.replace /\n/g, @lineFeed

      # fallback
      fallback.push("#{cs.id[0..7]}: #{cstr}")
