Sha256: 270baeaac0ed1cc0ad518453a04f2ee29fae44739051e5979f21ca3ce60bca0a

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

require 'xml/mapping'
require 'stash/wrapper/stash_file'

module Stash
  module Wrapper

    # Mapping class for `<st:inventory>`
    class Inventory
      include ::XML::Mapping

      array_node :files, 'file', class: StashFile, default_value: []
      numeric_node :num_files, '@num_files', default_value: 0

      # creates a new {Inventory} object
      # @param files [List<StashFile>] The inventory of files
      def initialize(files:)
        self.files = files
        self.num_files = files.size
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stash-wrapper-0.1.9 lib/stash/wrapper/inventory.rb
stash-wrapper-0.1.8 lib/stash/wrapper/inventory.rb
stash-wrapper-0.1.7 lib/stash/wrapper/inventory.rb
stash-wrapper-0.1.6 lib/stash/wrapper/inventory.rb
stash-wrapper-0.1.5 lib/stash/wrapper/inventory.rb
stash-wrapper-0.1.4 lib/stash/wrapper/inventory.rb