Class: Libis::Tools::MetsFile::File
Instance Attribute Summary collapse
Instance Method Summary
collapse
#id, #set_from_hash, #to_s
Instance Attribute Details
#dc_record ⇒ Object
Returns the value of attribute dc_record.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def dc_record
@dc_record
end
|
#entity_type ⇒ Object
Returns the value of attribute entity_type.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def entity_type
@entity_type
end
|
Returns the value of attribute label.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def label
@label
end
|
Returns the value of attribute location.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def location
@location
end
|
Returns the value of attribute mimetype.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def mimetype
@mimetype
end
|
#representation ⇒ Object
Returns the value of attribute representation.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def representation
@representation
end
|
#target_location ⇒ Object
Returns the value of attribute target_location.
69
70
71
|
# File 'lib/libis/tools/mets_file.rb', line 69
def target_location
@target_location
end
|
Instance Method Details
#add_manifestation(file) ⇒ Object
91
92
93
94
|
# File 'lib/libis/tools/mets_file.rb', line 91
def add_manifestation(file)
manifestations << file
file.master = self
end
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# File 'lib/libis/tools/mets_file.rb', line 111
def amd
dnx = {}
tech_data = []
data = {
label: label,
fileMIMEType: mimetype,
fileOriginalName: orig_name,
fileOriginalPath: orig_path,
FileEntityType: entity_type,
}.cleanup
tech_data << TechGeneralFile.new(data) unless data.empty?
dnx[:tech] = tech_data unless tech_data.empty?
dnx
end
|
75
76
77
|
# File 'lib/libis/tools/mets_file.rb', line 75
def group_id
"grp#{master.id rescue id}"
end
|
#manifestations ⇒ Object
87
88
89
|
# File 'lib/libis/tools/mets_file.rb', line 87
def manifestations
@manifestations ||= Array.new
end
|
79
80
81
|
# File 'lib/libis/tools/mets_file.rb', line 79
def master
@master ||= nil
end
|
#master=(file) ⇒ Object
83
84
85
|
# File 'lib/libis/tools/mets_file.rb', line 83
def master=(file)
@master = file
end
|
#orig_name ⇒ Object
96
97
98
|
# File 'lib/libis/tools/mets_file.rb', line 96
def orig_name
::File.basename(location)
end
|
#orig_path ⇒ Object
100
101
102
|
# File 'lib/libis/tools/mets_file.rb', line 100
def orig_path
::File.dirname(location)
end
|
104
105
106
107
108
109
|
# File 'lib/libis/tools/mets_file.rb', line 104
def target
if target_location.nil?
return "#{xml_id}#{::File.extname(location)}"
end
target_location
end
|
71
72
73
|
# File 'lib/libis/tools/mets_file.rb', line 71
def xml_id
"fid#{id}"
end
|