class Ddr::Fits

Constants

EXIFTOOL
FITS_SCHEMA
FITS_XMLNS

Public Class Methods

xml_template() click to toggle source
# File lib/ddr/fits.rb, line 82
def self.xml_template
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.fits("xmlns"=>FITS_XMLNS,
             "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
             "xsi:schemaLocation"=>"http://hul.harvard.edu/ois/xml/ns/fits/fits_output #{FITS_SCHEMA}")
  end
  builder.doc
end

Public Instance Methods

color_space() click to toggle source
# File lib/ddr/fits.rb, line 58
def color_space
  root.xpath('fits:metadata/fits:image/fits:colorSpace', fits: FITS_XMLNS).map(&:text)
end
created() click to toggle source
# File lib/ddr/fits.rb, line 42
def created
  root.xpath('fits:fileinfo/fits:created', fits: FITS_XMLNS).map(&:text)
end
creating_application() click to toggle source
# File lib/ddr/fits.rb, line 46
def creating_application
  root.xpath('fits:fileinfo/fits:creatingApplicationName', fits: FITS_XMLNS).map(&:text)
end
extent() click to toggle source
# File lib/ddr/fits.rb, line 50
def extent
  root.xpath('fits:fileinfo/fits:size', fits: FITS_XMLNS).map(&:text)
end
format_label() click to toggle source
# File lib/ddr/fits.rb, line 17
def format_label
  root.xpath('fits:identification/fits:identity/@format', fits: FITS_XMLNS).map(&:value)
end
format_version() click to toggle source
# File lib/ddr/fits.rb, line 21
def format_version
  root.xpath('fits:identification/fits:identity/fits:version', fits: FITS_XMLNS).map(&:text)
end
icc_profile_name() click to toggle source
# File lib/ddr/fits.rb, line 62
def icc_profile_name
  root.xpath('fits:metadata/fits:image/fits:iccProfileName', fits: FITS_XMLNS).map(&:text)
end
icc_profile_version() click to toggle source
# File lib/ddr/fits.rb, line 66
def icc_profile_version
  root.xpath('fits:metadata/fits:image/fits:iccProfileVersion', fits: FITS_XMLNS).map(&:text)
end
image_height() click to toggle source
# File lib/ddr/fits.rb, line 70
def image_height
  root.xpath('fits:metadata/fits:image/fits:imageHeight', fits: FITS_XMLNS).map(&:text)
end
image_width() click to toggle source
# File lib/ddr/fits.rb, line 74
def image_width
  root.xpath('fits:metadata/fits:image/fits:imageWidth', fits: FITS_XMLNS).map(&:text)
end
md5() click to toggle source
# File lib/ddr/fits.rb, line 54
def md5
  root.xpath('fits:fileinfo/fits:md5checksum', fits: FITS_XMLNS).map(&:text)
end
media_type() click to toggle source
# File lib/ddr/fits.rb, line 25
def media_type
  root.xpath('fits:identification/fits:identity/@mimetype', fits: FITS_XMLNS).map(&:value)
end
modified() click to toggle source
# File lib/ddr/fits.rb, line 78
def modified
  root.xpath("fits:fileinfo/fits:lastmodified[@toolname != '#{EXIFTOOL}']", fits: FITS_XMLNS).map(&:text)
end
pronom_identifier() click to toggle source
# File lib/ddr/fits.rb, line 29
def pronom_identifier
  root.xpath('fits:identification/fits:identity/fits:externalIdentifier[@type = "puid"]', fits: FITS_XMLNS)
      .map(&:text)
end
timestamp() click to toggle source
# File lib/ddr/fits.rb, line 13
def timestamp
  root.xpath('@timestamp').map(&:value)
end
valid() click to toggle source
# File lib/ddr/fits.rb, line 34
def valid
  root.xpath('fits:filestatus/fits:valid', fits: FITS_XMLNS).map(&:text)
end
version() click to toggle source
# File lib/ddr/fits.rb, line 9
def version
  root.xpath('@version').map(&:value)
end
well_formed() click to toggle source
# File lib/ddr/fits.rb, line 38
def well_formed
  root.xpath('fits:filestatus/fits:well-formed', fits: FITS_XMLNS).map(&:text)
end

Private Instance Methods

root() click to toggle source
# File lib/ddr/fits.rb, line 93
def root
  xpath('//fits:fits', fits: FITS_XMLNS).first
end