Method: RCAP::Base::Alert#initialize

Defined in:
lib/rcap/base/alert.rb

#initialize {|alert| ... } ⇒ Alert

Initialises a new Alert object. Yields the initialised alert to a block.

Examples:

alert = RCAP::CAP_1_2::Alert.new do |alert|
          alert.sender = alerts@example.org
          alert.status = Alert::STATUS_ACTUAL
          alert.msg_type = Alert::MSG_TYPE_ALERT
          alert.scope = Alert::SCOPE_PUBLIC
        end

Yield Parameters:

  • alert (Alert)

    The newly initialised Alert.



83
84
85
86
87
88
89
90
91
# File 'lib/rcap/base/alert.rb', line 83

def initialize
  @identifier  = RCAP.generate_identifier
  @addresses   = []
  @codes       = []
  @references  = []
  @incidents   = []
  @infos       = []
  yield(self) if block_given?
end