module Proclaim

Constants

VERSION

Public Class Methods

after_new_comment(*callbacks, &block) click to toggle source
# File lib/proclaim.rb, line 79
def self.after_new_comment(*callbacks, &block)
        callbacks.each do |callback|
                if callback.respond_to? :call
                        @@new_comment_callbacks.unshift(callback)
                else
                        raise "Proclaim does not support callbacks that aren't blocks or "\
                              "Procs"
                end
        end

        if block_given?
                @@new_comment_callbacks.unshift(block)
        end
end
after_new_subscription(*callbacks, &block) click to toggle source
# File lib/proclaim.rb, line 98
def self.after_new_subscription(*callbacks, &block)
        callbacks.each do |callback|
                if callback.respond_to? :call
                        @@new_subscription_callbacks.unshift(callback)
                else
                        raise "Proclaim does not support callbacks that aren't blocks or "\
                              "Procs"
                end
        end

        if block_given?
                @@new_subscription_callbacks.unshift(block)
        end
end
after_post_published(*callbacks, &block) click to toggle source
# File lib/proclaim.rb, line 60
def self.after_post_published(*callbacks, &block)
        callbacks.each do |callback|
                if callback.respond_to? :call
                        @@post_published_callbacks.unshift(callback)
                else
                        raise "Proclaim does not support callbacks that aren't blocks or "\
                              "Procs"
                end
        end

        if block_given?
                @@post_published_callbacks.unshift(block)
        end
end
notify_new_comment(comment) click to toggle source
# File lib/proclaim.rb, line 123
def self.notify_new_comment(comment)
        @@new_comment_callbacks.each do |callback|
                callback.call(comment)
        end
end
notify_new_subscription(subscription) click to toggle source
# File lib/proclaim.rb, line 129
def self.notify_new_subscription(subscription)
        @@new_subscription_callbacks.each do |callback|
                callback.call(subscription)
        end
end
notify_post_published(post) click to toggle source
# File lib/proclaim.rb, line 117
def self.notify_post_published(post)
        @@post_published_callbacks.each do |callback|
                callback.call(post)
        end
end
reset_new_comment_callbacks() click to toggle source
# File lib/proclaim.rb, line 94
def self.reset_new_comment_callbacks
        @@new_comment_callbacks = Array.new
end
reset_new_subscription_callbacks() click to toggle source
# File lib/proclaim.rb, line 113
def self.reset_new_subscription_callbacks
        @@new_subscription_callbacks = Array.new
end
reset_post_published_callbacks() click to toggle source
# File lib/proclaim.rb, line 75
def self.reset_post_published_callbacks
        @@post_published_callbacks = Array.new
end
setup() { |self| ... } click to toggle source

Default way to setup Proclaim from initializer

# File lib/proclaim.rb, line 56
def self.setup
        yield self
end