Module: Faymora::Connection

Included in:
Service
Defined in:
lib/faymora/connection.rb

Instance Method Summary collapse

Instance Method Details

#on_error(&block) ⇒ Object



25
26
27
# File 'lib/faymora/connection.rb', line 25

def on_error( &block )
    @on_error = block
end

#on_item(item) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/faymora/connection.rb', line 4

def on_item( item )
    if passthrough?( item )
        forward item
        return
    end

    r = nil
    clock item do |i|
        r = process( i )
    end

    forward( r ) if r.is_a?( Item )
    nil
end

#passthrough?(item) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
# File 'lib/faymora/connection.rb', line 19

def passthrough?( item )
    return if !(ourself = item.passes.include?( self ))

    !ourself.touched?
end