Sha256: 1a35362e22c3e64951a82a68a390bd2d08fae2ad4a5b121610d8f205f752d122

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

module Oscal
  class MetadataBlock

    METADATA_VALUES = %i(title published last_modified version
      oscal_version remarks)

    attr_accessor *METADATA_VALUES

    def initialize(options={})
      options.each_pair.each do |key,val|
        key_name = key.gsub('-','_')

        unless METADATA_VALUES.include?(key_name.to_sym)
          raise UnknownAttributeError.new("Unknown key `#{key}` in MetadataBlock")
        end
        self.send("#{key_name}=", val)
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oscal-0.1.0 lib/oscal/metadata_block.rb