Class: BerkeleyLibrary::Util::ODS::XML::Manifest::FileEntry

Inherits:
ElementNode
  • Object
show all
Defined in:
lib/berkeley_library/util/ods/xml/manifest/file_entry.rb

Instance Attribute Summary collapse

Attributes inherited from ElementNode

#doc, #element_name, #namespace

Instance Method Summary collapse

Methods inherited from ElementNode

#add_child, #attributes, #children, #clear_attribute, #create_element, #element, #ensure_element!, #prefix, #prefixed_attr_name, #set_attribute

Constructor Details

#initialize(full_path, media_type = nil, manifest:) ⇒ FileEntry

Returns a new instance of FileEntry.



14
15
16
17
18
19
20
21
22
# File 'lib/berkeley_library/util/ods/xml/manifest/file_entry.rb', line 14

def initialize(full_path, media_type = nil, manifest:)
  super(:manifest, 'file-entry', doc: manifest.doc)

  @full_path = full_path
  @media_type = media_type || media_type_for(full_path)
  @manifest = manifest

  set_default_attributes!
end

Instance Attribute Details

#full_pathObject (readonly)

Returns the value of attribute full_path.



10
11
12
# File 'lib/berkeley_library/util/ods/xml/manifest/file_entry.rb', line 10

def full_path
  @full_path
end

#manifestObject (readonly)

Returns the value of attribute manifest.



12
13
14
# File 'lib/berkeley_library/util/ods/xml/manifest/file_entry.rb', line 12

def manifest
  @manifest
end

#media_typeObject (readonly)

Returns the value of attribute media_type.



11
12
13
# File 'lib/berkeley_library/util/ods/xml/manifest/file_entry.rb', line 11

def media_type
  @media_type
end