def map(opts)
      if opts.is_a? Hash
        opts.each do |channel, controller|
          if channel.is_a? String
            if FayeRails::Matcher.match? '/**', channel
              routing_extension.map(channel, controller)
            else
              raise ArgumentError, "Invalid channel: #{channel}"
            end
          elsif channel == :default
            if controller == :block
              routing_extension.block_unknown_channels!
            elsif controller == :drop
              routing_extension.drop_unknown_channels!
            elsif controller == :allow
              routing_extension.allow_unknown_channels!
            end
          end
        end
      end
    end
def map(opts)
      if opts.is_a? Hash
        opts.each do |channel, controller|
          if channel.is_a? String
            if FayeRails::Matcher.match? '/**', channel
              routing_extension.map(channel, controller)
            else
              raise ArgumentError, "Invalid channel: #{channel}"
            end
          elsif channel == :default
            if controller == :block
              routing_extension.block_unknown_channels!
            elsif controller == :drop
              routing_extension.drop_unknown_channels!
            elsif controller == :allow
              routing_extension.allow_unknown_channels!
            end
          end
        end
      end
    end
Rudimentary routing support for channels to controllers.

 @param opts
   a Hash of mappings either string keys (channel globs)
   mapping to controller constants eg:

     '/widgets/**' => WidgetsController

   or you can set the behaviour for unknown channels:

     :default => :block

   :default can be set to :allow, :drop or :block.
   if :drop is chosen then messages to unknown channels
   will be silently dropped, whereas if you choose
   :block then the message will be returned with the
   error "Permission denied."