Sha256: 84b9735c23eeced7107033387a3aea55811671020006a64a213da565e5e8977e

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module Waffle
  class Event
    class << self
      def occured(event_data, options = {})
        options = {
          :event_name => 'event',
          :queue => :default
        }.merge(options)

        unless event_data.is_a?(Hash)
          event_data = {'body' => event_data.to_s}
        end

        event_data.merge!({'occured_at' => Time.now})

        Waffle.queue(options[:queue]).publish(options[:event_name], event_data)
      end
      alias :occurred :occured
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
waffle-0.6.0 lib/waffle/event.rb
waffle-0.5.1 lib/waffle/event.rb
waffle-0.5.0 lib/waffle/event.rb