Sha256: 30735833e8a554c66d71b7fa745d0760dc949ee4868d2527ff37e4170fc87214

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module RCAP
  module CAP_1_0
    # In Info object is valid if
    # * it has an event
    # * it has an urgency with a valid value
    # * it has a severity with a valid value
    # * it has a certainty with a valid value
    # * all categories are valid and categories has at minimum 1 entry
    # * all Resource objects in the resources collection are valid
    # * all Area objects in the areas collection are valid
    class Info < RCAP::Base::Info
      validates_inclusion_of(:certainty, allow_nil: true, in: VALID_CERTAINTIES, message: "can only be assigned the following values: #{VALID_CERTAINTIES.join(', ')}")

      # @return [String]
      def xmlns
        Alert::XMLNS
      end

      # @return [Class]
      def event_code_class
        EventCode
      end

      # @return [Class]
      def parameter_class
        Parameter
      end

      # @return [Class]
      def resource_class
        Resource
      end

      # @return [Class]
      def area_class
        Area
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rcap-2.7.4 lib/rcap/cap_1_0/info.rb
rcap-2.7.3 lib/rcap/cap_1_0/info.rb