 
+
+class SiriusUtils
+  @is_function: (a) ->
+    Object.prototype.toString.call(a) is '[object Function]'
+
+  @is_string: (a) ->
+    Object.prototype.toString.call(a) is '[object String]'
+
+  @is_array: (a) ->
+    Object.prototype.toString.call(a) is '[object Array]'
+
+  @camelize: (str) ->
+    str.charAt(0).toUpperCase() + str.slice(1)
 ###
   RoutePart is a parser for string route representation
 ###

    @args = args
    true

###
  Main Object.


    # @event application:hashchange [current_url, prev_url]
    # @event application:404 when url not found
    # @event application:run after running
    create: (routes, fn = ->) ->
      current = prev = window.location.hash

      is_f = (f) ->
        Object.prototype.toString.call(f) == '[object Function]'

      for url, action of routes when url.indexOf("#") != 0 && url.toString() != "404"
        do (url, action) =>
          action = if is_f(action) then action else new ControlFlow(action) #FIXME
          z = url.match(/^([a-zA-Z:]+)(\s+)?(.*)?/)
          event_name = z[1]
          selector   = z[3] || document #when it a custom event: 'custom:event' for example
          SiriusApplication.adapter.bind(selector, event_name, action.handle_event || action)

      # for cache change obj[k, v] to array [[k,v]]
      array_of_routes = for url, action of routes when url.toString() != "404"
        do (url, action) ->
          url    = new RoutePart(url)
          action = if is_f(action) then action else new ControlFlow(action) #FIXME
          [url, action]

      window.onhashchange = (e) =>
        prev = current
