Sha256: 30d564bfa7f7da8776a4bba0598e711e9d00e49921c3a9fff562bf0bdb559df4

Contents?: true

Size: 367 Bytes

Versions: 1

Compression:

Stored size: 367 Bytes

Contents

module Waffle
  class Event
    class << self
      def occured(event_name = 'event', event_data = nil)
        unless event_data.is_a?(Hash)
          event_data = {'body' => event_data.to_s}
        end

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

        Waffle.publish(event_name, event_data)
      end
      alias :occurred :occured
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
waffle-0.4.0 lib/waffle/event.rb