Method: Blather::DSL#before

Defined in:
lib/blather/client/dsl.rb

#before(handler = nil, *guards) {|Blather::Stanza| ... } ⇒ Object

Setup a before filter

run before against

Parameters:

  • handler (Symbol) (defaults to: nil)

    (optional) the stanza handler the filter should

  • guards (guards)

    (optional) a set of guards to check the stanza

Yields:



166
167
168
# File 'lib/blather/client/dsl.rb', line 166

def before(handler = nil, *guards, &block)
  client.register_filter :before, handler, *guards, &block
end