Class FayeRails::Filter::DSL
In: lib/faye-rails/filter.rb
Parent: Object

Methods

block   channel_matches?   client_id?   data   data?   drop   in?   incoming?   meta?   modify   new   out?   outgoing?   pass   service?   subscribing?   subscription?   unsubscribing?  

Attributes

callback  [R]  A small wrapper class around filter blocks to add some sugar to ease filter (Faye extension) creation.
channel  [R]  A small wrapper class around filter blocks to add some sugar to ease filter (Faye extension) creation.
direction  [R]  A small wrapper class around filter blocks to add some sugar to ease filter (Faye extension) creation.
message  [R]  A small wrapper class around filter blocks to add some sugar to ease filter (Faye extension) creation.
original_message  [R]  A small wrapper class around filter blocks to add some sugar to ease filter (Faye extension) creation.

Public Class methods

Called by FayeRails::Filter when Faye passes messages in for evaluation. @param block

  The block you wish to execute whenever a matching
  message is recieved.

@param channel

 optional: if present then the block will only be called for matching messages, otherwise all messages will be passed.

Public Instance methods

Syntactic sugar around callback.call which adds an error message to the message and passes it back to Faye, which will send back a rejection message to the sending client. @param reason

  The error message to be sent back to the client.

Syntactic sugar around callback.call which returns nil to Faye - effectively dropping the message.

in?()

Alias for incoming?

Syntactic sugar around callback.call which passes the passed argument back to Faye in place of the original message. @param new_message

  Replacement message to send back to Faye.
out?()

Alias for outgoing?

Syntactic sugar around callback.call which passes back the original message unmodified.

Easier than testing message[‘channel’] every time

[Validate]