Class: Libis::Tools::MetsFile::Div

Inherits:
Object
  • Object
show all
Includes:
IdContainer
Defined in:
lib/libis/tools/mets_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IdContainer

#id, #set_from_hash, #to_s

Instance Attribute Details

#labelObject

Returns the value of attribute label.



474
475
476
# File 'lib/libis/tools/mets_file.rb', line 474

def label
  @label
end

Instance Method Details

#<<(obj) ⇒ Object



492
493
494
495
496
497
498
499
500
501
# File 'lib/libis/tools/mets_file.rb', line 492

def <<(obj)
  case obj
    when File
      files << obj
    when Div
      divs << obj
    else
      raise RuntimeError, "Child object type not supported: #{obj.class}"
  end
end

#childrenObject



480
481
482
# File 'lib/libis/tools/mets_file.rb', line 480

def children
  files + divs
end

#divsObject



488
489
490
# File 'lib/libis/tools/mets_file.rb', line 488

def divs
  @divs ||= Array.new
end

#filesObject



484
485
486
# File 'lib/libis/tools/mets_file.rb', line 484

def files
  @files ||= Array.new
end

#xml_idObject



476
477
478
# File 'lib/libis/tools/mets_file.rb', line 476

def xml_id
  "div-#{id}"
end