class Libis::Tools::MetsFile::Div

Container class for creating a division in the METS.

Attributes

label[RW]

Public Instance Methods

<<(obj) click to toggle source

Add an item ({File} or {Div}) to the current division

# File lib/libis/tools/mets_objects.rb, line 330
def <<(obj)
  self.mutex.synchronize do
    case obj
      when File
        files << obj
      when Div
        divs << obj
      else
        raise RuntimeError, "Child object type not supported: #{obj.class}"
    end
  end
end
children() click to toggle source

All items stored in the current division

# File lib/libis/tools/mets_objects.rb, line 311
def children
  files + divs
end
divs() click to toggle source

All division items stored in the current division

# File lib/libis/tools/mets_objects.rb, line 323
def divs
  self.mutex.synchronize do
    @divs ||= Array.new
  end
end
files() click to toggle source

All file items stored in the current division

# File lib/libis/tools/mets_objects.rb, line 316
def files
  self.mutex.synchronize do
    @files ||= Array.new
  end
end
xml_id() click to toggle source

The id that will be used in the XML file to reference this division.

# File lib/libis/tools/mets_objects.rb, line 306
def xml_id
  "div-#{@id}"
end