Sha256: cb229a508ddf532cbaedd375c6d521baba7409c42e37ab623a6e80505b5b2f17

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 Bytes

Contents

require_relative "base_class"

module Oscal
  class MetadataBlock < Oscal::BaseClass
    KEY = %i(title published last_modified version
             oscal_version revisions document_ids props links roles
             locations parties responsible_parties remarks)

    attr_accessor *KEY

    attr_serializable *KEY

    def set_value(key_name, val)
      case key_name
      when "revisions"
        Revision.wrap(val)
      when "docuement_ids"
        DocumentId.wrap(val)
      when "props"
        Property.wrap(val)
      when "links"
        Link.wrap(val)
      when "roles"
        Role.wrap(val)
      when "locations"
        Location.wrap(val)
      when "parties"
        Party.wrap(val)
      when "responsible_parties"
        ResponsibleParty.wrap(val)
      else
        val
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oscal-0.2.3 lib/oscal/metadata_block.rb
oscal-0.2.2 lib/oscal/metadata_block.rb
oscal-0.2.0 lib/oscal/metadata_block.rb