Sha256: f00c354c02083f57ccd748f69930e1a164377aacadf9292808f0c5a628b625f1

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require 'xml/mapping'
require_relative 'version'
require_relative 'license'
require_relative 'embargo'
require_relative 'inventory'

module Stash
  module Wrapper
    # Mapping for `<st:stash_administrative>`
    class StashAdministrative
      include ::XML::Mapping
      object_node :version, 'version', class: Version
      object_node :license, 'license', class: License
      object_node :embargo, 'embargo', class: Embargo
      object_node :inventory, 'inventory', class: Inventory

      # Creates a new {StashAdministrative}
      #
      # @param version [Version] the version
      # @param license [License] the license
      # @param embargo [Embargo, nil] the embargo information. If no `Embargo`
      #   is supplied, it will default to an embargo of type {EmbargoType::NONE}
      #   with the current date as start and end.
      # @param inventory [Inventory, nil] the (optional) file inventory
      def initialize(version:, license:, embargo: nil, inventory: nil)
        self.version = version
        self.license = license
        self.embargo = embargo || Embargo.none
        self.inventory = inventory
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stash-wrapper-0.1.3 lib/stash/wrapper/stash_administrative.rb
stash-wrapper-0.1.2 lib/stash/wrapper/stash_administrative.rb