On Nov 20, 9:13 am, Farrel L. [email protected] wrote:
RCAP now supports the generation of YAML documents to represent each alert.
For more detailed release notes seehttp://www.aimred.com/news/developers/2009/11/20/rcap_0_2_releasedor
view the RCAP project page athttp://www.aimred.com/projects/rcap
Hi Farrel
I’m curious. What does CAP get used for / who is using CAP?
Also, if I might offer a suggestion or two…
You might allow symbols in place of constants, eg.
alert = Alert.new( :sender =>
‘[email protected]’,
:status => :STATUS_ACTUAL, # instead of
Alert::STATUS_ACTUAL
:msg_type => :MSG_TYPE_ALERT,
:scope => :SCOPE_PUBLIC,
:infos => Info.new( :event => ‘Liquid
Petroleoum Tanker Fire’,
:language => ‘en-ZA’,
:categories =>
[ :CATEGORY_TRANSPORT, :CATEGORY_FIRE ],
:urgency
=> :URGENCY_IMMEDIATE,
:severity
=> :SEVERITY_SEVERE,
:certainty
=> :CERTAINTY_OBSERVED,
:headline => ‘LIQUID
PETROLEOUM TANKER FIRE ON N2 INCOMING FREEWAY’,
:description => ‘A liquid
petroleoum tanker has caught fire on the N2 incoming freeway 1km
after the
R300 interchange. Municipal fire fighting crews have been dispatched.
Traffic
control officers are on the scene and have diverted traffic onto
alternate
routes.’ ))
Internally the symbols can be translated into the constants.
Also, considering how it used, it seems like the perfect candidate for
a simple DSL.
alert = Alert do
sender
‘[email protected]’
status :STATUS_ACTUAL
msg_type :MSG_TYPE_ALERT
scope :SCOPE_PUBLIC
info do
event ‘Liquid Petroleoum Tanker Fire’
language ‘en-ZA’
categories
[ :CATEGORY_TRANSPORT, :CATEGORY_FIRE ]
urgency :URGENCY_IMMEDIATE
severity :SEVERITY_SEVERE
certainty :CERTAINTY_OBSERVED
headline ‘LIQUID PETROLEOUM TANKER FIRE ON N2
INCOMING FREEWAY’
description ‘A liquid petroleoum tanker has
caught fire on the N2 incoming freeway 1km
after the R300 interchange.
Municipal fire fighting crews have been dispatched.
Traffic control officers are
on the scene and have diverted traffic onto
alternate routes.’
end
end