Module: Merritt::Manifest::File

Defined in:
lib/merritt/manifest/file.rb

Overview

A marker interface for file-like objects. Each field may or may not be relevant to a given manifest format.

Instance Attribute Summary collapse

Instance Attribute Details

#file_last_modifiednil, DateTime (readonly)

Returns date and time the file was last modified. Note that according to the Merritt Ingest Service docs, “modification time field SHOULD NOT be specified, and will be ignored if provided.”.

Returns:

  • (nil, DateTime)

    date and time the file was last modified. Note that according to the Merritt Ingest Service docs, “modification time field SHOULD NOT be specified, and will be ignored if provided.”



23
24
25
# File 'lib/merritt/manifest/file.rb', line 23

def file_last_modified
  @file_last_modified
end

#file_namenil, String (readonly)

Returns the file name. If not present, will be inferred from #file_url.

Returns:

  • (nil, String)

    the file name. If not present, will be inferred from #file_url.



27
28
29
# File 'lib/merritt/manifest/file.rb', line 27

def file_name
  @file_name
end

#file_sizenil, Integer (readonly)

Returns the file size in bytes.

Returns:

  • (nil, Integer)

    the file size in bytes.



18
19
20
# File 'lib/merritt/manifest/file.rb', line 18

def file_size
  @file_size
end

#file_urlnil, URI (readonly)

Returns the URL at which to retrieve the file.

Returns:

  • (nil, URI)

    the URL at which to retrieve the file



9
10
11
# File 'lib/merritt/manifest/file.rb', line 9

def file_url
  @file_url
end

#hash_algorithmnil, String (readonly)

Returns the hash algorithm used to hash the file.

Returns:

  • (nil, String)

    the hash algorithm used to hash the file



12
13
14
# File 'lib/merritt/manifest/file.rb', line 12

def hash_algorithm
  @hash_algorithm
end

#hash_valuenil, String (readonly)

Returns the hash value.

Returns:

  • (nil, String)

    the hash value



15
16
17
# File 'lib/merritt/manifest/file.rb', line 15

def hash_value
  @hash_value
end

#mime_typenil, MIME::Type (readonly)

Returns the mime type.

Returns:

  • (nil, MIME::Type)

    the mime type



30
31
32
# File 'lib/merritt/manifest/file.rb', line 30

def mime_type
  @mime_type
end