summaryrefslogtreecommitdiffstats
path: root/lib/puppet/event.rb
blob: 98ea92c9dc0183fa82095339cb7b13d56c77813c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'puppet'
require 'puppet/type'

module Puppet
    # events are transient packets of information; they result in one or more (or none)
    # subscriptions getting triggered, and then they get cleared
    # eventually, these will be passed on to some central event system
	class Event
        include Puppet
		attr_accessor :event, :source, :transaction

        @@events = []

		def initialize(args)
            unless args.include?(:event) and args.include?(:source)
				raise Puppet::DevError, "Event.new called incorrectly"
			end

			@change = args[:change]
			@event = args[:event]
			@source = args[:source]
			@transaction = args[:transaction]
		end

        def to_s
            @source.to_s + " -> " + self.event.to_s
        end
	end
end

# $Id$