Sha256: 6be5e6e1bd9b1be7185b2c88bc193e171f6b23738cc14eda42ed6d4238711568

Contents?: true

Size: 1019 Bytes

Versions: 4

Compression:

Stored size: 1019 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
rcap-2.7.0 lib/rcap/cap_1_0/info.rb
rcap-2.6.0 lib/rcap/cap_1_0/info.rb
rcap-2.5.1 lib/rcap/cap_1_0/info.rb
rcap-2.5.0 lib/rcap/cap_1_0/info.rb