Module: Hippo::Concerns::PubSub::PendingListeners

Defined in:
lib/hippo/concerns/pub_sub.rb

Constant Summary collapse

@@listeners =
Hash.new{ |hash, klass|
    hash[klass] = Hash.new{ |kh, event|
        kh[event]=Array.new
    }
}

Class Method Summary collapse

Class Method Details

.add(class_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


37
38
39
# File 'lib/hippo/concerns/pub_sub.rb', line 37

def add(class_name)
    @@listeners[class_name]
end

.claim(class_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


28
29
30
31
32
33
34
# File 'lib/hippo/concerns/pub_sub.rb', line 28

def claim(class_name)
    if @@listeners.has_key?(class_name)
        return @@listeners.delete(class_name)
    else
        return {}
    end
end