Sha256: fbf988813be26b74631ba8c8dc07e2fdc8716f49e3a7730b62db9184b18a11c9

Contents?: true

Size: 401 Bytes

Versions: 6

Compression:

Stored size: 401 Bytes

Contents

@namespace = (nspace, payload, context) ->
  payload = payload || {}
  context = context || window

  parts = nspace.split "."
  parent = context
  currentPart = ""

  while currentPart = parts.shift()
    if parts.length != 0
      parent[currentPart] = parent[currentPart] || {}
    else
      parent[currentPart] = parent[currentPart] || payload

    parent = parent[currentPart]

  payload parent

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sensu-dashboard-0.10.4 lib/sensu-dashboard/assets/javascripts/namespace.coffee
sensu-dashboard-0.10.3 lib/sensu-dashboard/assets/javascripts/namespace.coffee
sensu-dashboard-0.10.2 lib/sensu-dashboard/assets/javascripts/namespace.coffee
sensu-dashboard-0.10.1 lib/sensu-dashboard/assets/javascripts/namespace.coffee
sensu-dashboard-0.10.0 lib/sensu-dashboard/assets/javascripts/namespace.coffee
sensu-dashboard-0.9.9 lib/sensu-dashboard/assets/javascripts/namespace.coffee