Class: WatcherEvent

Inherits:
Object show all
Defined in:
lib/watcher_event.rb

Overview

Encodes the information of an event that was triggered.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



8
9
10
# File 'lib/watcher_event.rb', line 8

def message
  @message
end

#timestampObject

Returns the value of attribute timestamp.



6
7
8
# File 'lib/watcher_event.rb', line 6

def timestamp
  @timestamp
end

#watcherObject

Returns the value of attribute watcher.



7
8
9
# File 'lib/watcher_event.rb', line 7

def watcher
  @watcher
end

Instance Method Details

#to_xmlObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/watcher_event.rb', line 10

def to_xml
  builder = Builder::XmlMarkup.new()
  builder.instruct!
  builder.event do 
    builder.timestamp(timestamp)
    builder.message(message)
    builder.watcher do
      builder.name(watcher.name)
      builder.watcher_type(watcher.class.name)
    end
  end
end