Class: Idml::Parts::XmpRdf

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/idml/parts/xmp.rb

Overview

<rdf:RDF> — collection of <rdf:Description> siblings inside an XMP packet. Per IDML's META-INF/metadata.xml, there is typically one Description per schema group.

Instance Method Summary collapse

Instance Method Details

#authorObject



261
262
263
# File 'lib/idml/parts/xmp.rb', line 261

def author
  descriptions.filter_map(&:author).first
end

#create_dateObject



281
282
283
# File 'lib/idml/parts/xmp.rb', line 281

def create_date
  descriptions.filter_map(&:create_date).first&.value
end

#creator_toolObject



277
278
279
# File 'lib/idml/parts/xmp.rb', line 277

def creator_tool
  descriptions.filter_map(&:creator_tool).first&.value
end

#descriptionObject



273
274
275
# File 'lib/idml/parts/xmp.rb', line 273

def description
  descriptions.map(&:description).find(&:itself)&.value
end

#first_descriptionObject

Merged view across all Descriptions. Each attribute returns the first non-nil value across the descriptions.



253
254
255
# File 'lib/idml/parts/xmp.rb', line 253

def first_description
  descriptions.first
end

#keywordsObject



269
270
271
# File 'lib/idml/parts/xmp.rb', line 269

def keywords
  subject&.join(", ")
end

#modify_dateObject



285
286
287
# File 'lib/idml/parts/xmp.rb', line 285

def modify_date
  descriptions.filter_map(&:modify_date).first&.value
end

#subjectObject



265
266
267
# File 'lib/idml/parts/xmp.rb', line 265

def subject
  descriptions.filter_map(&:subject).find(&:itself)&.values
end

#titleObject



257
258
259
# File 'lib/idml/parts/xmp.rb', line 257

def title
  descriptions.map(&:title).find(&:itself)&.value
end