class Hydra::Works::Characterization::FitsDocument

Constants

PROXIED_TERMS

Attributes

ng_xml[RW]

Public Class Methods

terminology() click to toggle source
# File lib/hydra/works/characterization/fits_document.rb, line 24
def self.terminology
  struct = Struct.new(:proxied_term).new
  terminology = Struct.new(:terms)
  terminology.new(PROXIED_TERMS.map { |t| [t, struct] }.to_h)
end
xml_template() click to toggle source
# File lib/hydra/works/characterization/fits_document.rb, line 353
def self.xml_template
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.fits(xmlns: 'http://hul.harvard.edu/ois/xml/ns/fits/fits_output',
             'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
             'xsi:schemaLocation' => "http://hul.harvard.edu/ois/xml/ns/fits/fits_output
             http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd",
             version: '0.6.0', timestamp: '1/25/12 11:04 AM') do
      xml.identification { xml.identity(toolname: 'FITS') }
    end
  end
  builder.doc
end

Public Instance Methods

__cleanup__() click to toggle source

Cleanup phase; ugly name to avoid collisions. The send construct here is required to fix up values because the setters are not defined, but rather applied with method_missing.

# File lib/hydra/works/characterization/fits_document.rb, line 348
def __cleanup__
  # Add any other scrubbers here; don't return any particular value
  nil
end
aspect_ratio() click to toggle source

t.aspect_ratio(proxy: [:metadata, :video, :track, :aspect_ratio])

# File lib/hydra/works/characterization/fits_document.rb, line 341
def aspect_ratio
  ng_xml.css("fits > metadata > video > track[type='video'] > aspectRatio").map(&:text)
end
audio_bit_rate() click to toggle source

t.audio_bit_rate(proxy: [:metadata, :audio, :bit_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 306
def audio_bit_rate
  ng_xml.css("fits > metadata > audio > bitRate").map(&:text)
end
audio_duration() click to toggle source

t.audio_duration(proxy: [:metadata, :audio, :duration])

# File lib/hydra/works/characterization/fits_document.rb, line 276
def audio_duration
  ng_xml.css("fits > metadata > audio > duration").map(&:text)
end
audio_sample_rate() click to toggle source

t.audio_sample_rate(proxy: [:metadata, :audio, :sample_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 286
def audio_sample_rate
  ng_xml.css("fits > metadata > audio > sampleRate").map(&:text)
end
bit_depth() click to toggle source

t.bit_depth(proxy: [:metadata, :audio, :bit_depth])

# File lib/hydra/works/characterization/fits_document.rb, line 281
def bit_depth
  ng_xml.css("fits > metadata > audio > bitDepth").map(&:text)
end
byte_order() click to toggle source

t.byte_order(proxy: [:metadata, :image, :byte_order])

# File lib/hydra/works/characterization/fits_document.rb, line 159
def byte_order
  ng_xml.css("fits > metadata > image > byteOrder").map(&:text)
end
capture_device() click to toggle source

t.capture_device(proxy: [:metadata, :image, :capture_device])

# File lib/hydra/works/characterization/fits_document.rb, line 231
def capture_device
  ng_xml.css("fits > metadata > image > captureDevice").map(&:text)
end
channels() click to toggle source

t.channels(proxy: [:metadata, :audio, :channels])

# File lib/hydra/works/characterization/fits_document.rb, line 291
def channels
  ng_xml.css("fits > metadata > audio > channels").map(&:text)
end
character_count() click to toggle source

t.character_count(proxy: [:metadata, :document, :character_count])

# File lib/hydra/works/characterization/fits_document.rb, line 134
def character_count
  ng_xml.css("fits > metadata > document > characterCount").map(&:text)
end
character_set() click to toggle source

t.character_set(proxy: [:metadata, :text, :character_set])

# File lib/hydra/works/characterization/fits_document.rb, line 261
def character_set
  ng_xml.css("fits > metadata > text > charset").map(&:text)
end
color_map() click to toggle source

t.color_map(proxy: [:metadata, :image, :color_map])

# File lib/hydra/works/characterization/fits_document.rb, line 221
def color_map
  ng_xml.css("fits > metadata > image > colorMap").map(&:text)
end
color_space() click to toggle source

t.color_space(proxy: [:metadata, :image, :color_space])

# File lib/hydra/works/characterization/fits_document.rb, line 201
def color_space
  ng_xml.css("fits > metadata > image > colorSpace").map(&:text)
end
compression() click to toggle source

t.compression(proxy: [:metadata, :image, :compression])

# File lib/hydra/works/characterization/fits_document.rb, line 164
def compression
  ng_xml.css("fits > metadata > image > compressionScheme").map(&:text)
end
data_format() click to toggle source

t.data_format(proxy: [:metadata, :audio, :data_format])

# File lib/hydra/works/characterization/fits_document.rb, line 296
def data_format
  ng_xml.css("fits > metadata > audio > dataFormatType").map(&:text)
end
date_created() click to toggle source

t.date_created(proxy: [:fileinfo, :date_created])

# File lib/hydra/works/characterization/fits_document.rb, line 74
def date_created
  ng_xml.css("fits > fileinfo > created[toolname='Exiftool']").map(&:text)
end
date_modified() click to toggle source

t.date_modified(proxy: [:fileinfo, :last_modified])

# File lib/hydra/works/characterization/fits_document.rb, line 59
def date_modified
  ng_xml.css("fits > fileinfo > lastmodified[toolname='Exiftool']").map(&:text)
end
exif_tool_version() click to toggle source

t.exif_tool_version(proxy: [:identification, :identity, :tool, :exif_tool_version])

# File lib/hydra/works/characterization/fits_document.rb, line 49
def exif_tool_version
  ng_xml.css("fits > identification > identity > tool[toolname='Exiftool']").map { |n| n['toolversion'] }
end
exif_version() click to toggle source

t.exif_version(proxy: [:metadata, :image, :exif_version])

# File lib/hydra/works/characterization/fits_document.rb, line 241
def exif_version
  ng_xml.css("fits > metadata > image > exifVersion[toolname='Exiftool']").map(&:text)
end
file_author() click to toggle source

t.file_author(proxy: [:metadata, :document, :file_author])

# File lib/hydra/works/characterization/fits_document.rb, line 114
def file_author
  ng_xml.css("fits > metadata > document > author").map(&:text)
end
file_language() click to toggle source

t.file_language(proxy: [:metadata, :document, :file_language])

# File lib/hydra/works/characterization/fits_document.rb, line 119
def file_language
  ng_xml.css("fits > metadata > document > language").map(&:text)
end
file_mime_type() click to toggle source

Can't use .mime_type because it's already defined for this document so method missing won't work. t.file_mime_type(proxy: [:identification, :identity, :mime_type])

# File lib/hydra/works/characterization/fits_document.rb, line 42
def file_mime_type
  # Sometimes, FITS reports the mimetype attribute as a comma-separated string.
  # All terms are arrays and, in this case, there is only one element, so scan the first.
  ng_xml.css("fits > identification > identity").map { |n| n['mimetype'].split(',').first }
end
file_size() click to toggle source

t.file_size(proxy: [:fileinfo, :file_size])

# File lib/hydra/works/characterization/fits_document.rb, line 54
def file_size
  ng_xml.css("fits > fileinfo > size").map(&:text)
end
file_title() click to toggle source

t.file_title(proxy: [:metadata, :document, :file_title])

# File lib/hydra/works/characterization/fits_document.rb, line 109
def file_title
  ng_xml.css("fits > metadata > document > title").map(&:text)
end
filename() click to toggle source

t.filename(proxy: [:fileinfo, :filename])

# File lib/hydra/works/characterization/fits_document.rb, line 64
def filename
  ng_xml.css("fits > fileinfo > filename").map(&:text)
end
filestatus_message() click to toggle source

t.filestatus_message(proxy: [:filestatus, :status_message])

# File lib/hydra/works/characterization/fits_document.rb, line 104
def filestatus_message
  ng_xml.css("fits > filestatus > message").map(&:text)
end
fits_version() click to toggle source

t.fits_version(proxy: [:fits, :fits_v])

# File lib/hydra/works/characterization/fits_document.rb, line 31
def fits_version
  ng_xml.css("fits").map { |n| n['version'].text }
end
format_label() click to toggle source

t.format_label(proxy: [:identification, :identity, :format_label])

# File lib/hydra/works/characterization/fits_document.rb, line 36
def format_label
  ng_xml.css("fits > identification > identity").map { |n| n['format'] }
end
frame_rate() click to toggle source

t.frame_rate(proxy: [:metadata, :video, :frame_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 326
def frame_rate
  ng_xml.css("fits > metadata > video > frameRate").map(&:text)
end
gps_timestamp() click to toggle source

t.gps_timestamp(proxy: [:metadata, :image, :gps_timestamp])

# File lib/hydra/works/characterization/fits_document.rb, line 246
def gps_timestamp
  ng_xml.css("fits > metadata > image > gpsTimeStamp").map(&:text)
end
graphics_count() click to toggle source

t.graphics_count(proxy: [:metadata, :document, :graphics_count])

# File lib/hydra/works/characterization/fits_document.rb, line 154
def graphics_count
  ng_xml.css("fits > metadata > document > graphicsCount").map(&:text)
end
height() click to toggle source

t.height(proxy: [:metadata, :image, :height])

# File lib/hydra/works/characterization/fits_document.rb, line 174
def height
  ng_xml.css("fits > metadata > image > imageHeight").map(&:text)
end
image_producer() click to toggle source

t.image_producer(proxy: [:metadata, :image, :image_producer])

# File lib/hydra/works/characterization/fits_document.rb, line 226
def image_producer
  ng_xml.css("fits > metadata > image > imageProducer").map(&:text)
end
latitude() click to toggle source

t.latitude(proxy: [:metadata, :image, :latitude])

# File lib/hydra/works/characterization/fits_document.rb, line 251
def latitude
  ng_xml.css("fits > metadata > image > gpsDestLatitude").map(&:text)
end
line_count() click to toggle source

t.line_count(proxy: [:metadata, :document, :line_count])

# File lib/hydra/works/characterization/fits_document.rb, line 144
def line_count
  ng_xml.css("fits > metadata > document > lineCount").map(&:text)
end
longitude() click to toggle source

t.longitude(proxy: [:metadata, :image, :longitude])

# File lib/hydra/works/characterization/fits_document.rb, line 256
def longitude
  ng_xml.css("fits > metadata > image > gpsDestLongitude").map(&:text)
end
markup_basis() click to toggle source

t.markup_basis(proxy: [:metadata, :text, :markup_basis])

# File lib/hydra/works/characterization/fits_document.rb, line 266
def markup_basis
  ng_xml.css("fits > metadata > text > markupBasis").map(&:text)
end
markup_language() click to toggle source

t.markup_language(proxy: [:metadata, :text, :markup_language])

# File lib/hydra/works/characterization/fits_document.rb, line 271
def markup_language
  ng_xml.css("fits > metadata > text > markupLanguage").map(&:text)
end
offset() click to toggle source

t.offset(proxy: [:metadata, :audio, :offset])

# File lib/hydra/works/characterization/fits_document.rb, line 301
def offset
  ng_xml.css("fits > metadata > audio > offset").map(&:text)
end
orientation() click to toggle source

t.orientation(proxy: [:metadata, :image, :orientation])

# File lib/hydra/works/characterization/fits_document.rb, line 216
def orientation
  ng_xml.css("fits > metadata > image > orientation").map(&:text)
end
original_checksum() click to toggle source

t.original_checksum(proxy: [:fileinfo, :original_checksum])

# File lib/hydra/works/characterization/fits_document.rb, line 69
def original_checksum
  ng_xml.css("fits > fileinfo > md5checksum").map(&:text)
end
page_count() click to toggle source

t.page_count(proxy: [:metadata, :document, :page_count])

# File lib/hydra/works/characterization/fits_document.rb, line 124
def page_count
  ng_xml.css("fits > metadata > document > pageCount").map(&:text)
end
paragraph_count() click to toggle source

t.paragraph_count(proxy: [:metadata, :document, :paragraph_count])

# File lib/hydra/works/characterization/fits_document.rb, line 139
def paragraph_count
  ng_xml.css("fits > metadata > document > paragraphCount").map(&:text)
end
profile_name() click to toggle source

t.profile_name(proxy: [:metadata, :image, :profile_name])

# File lib/hydra/works/characterization/fits_document.rb, line 206
def profile_name
  ng_xml.css("fits > metadata > image > iccProfileName").map(&:text)
end
profile_version() click to toggle source

t.profile_version(proxy: [:metadata, :image, :profile_version])

# File lib/hydra/works/characterization/fits_document.rb, line 211
def profile_version
  ng_xml.css("fits > metadata > image > iccProfileVersion").map(&:text)
end
proxied_term_hash() click to toggle source
# File lib/hydra/works/characterization/fits_document.rb, line 20
def proxied_term_hash
  PROXIED_TERMS.map { |t| [t, send(t)] }.to_h
end
rights_basis() click to toggle source

t.rights_basis(proxy: [:fileinfo, :rights_basis])

# File lib/hydra/works/characterization/fits_document.rb, line 79
def rights_basis
  ng_xml.css("fits > fileinfo > rightsBasis").map(&:text)
end
scanning_software() click to toggle source

t.scanning_software(proxy: [:metadata, :image, :scanning_software])

# File lib/hydra/works/characterization/fits_document.rb, line 236
def scanning_software
  ng_xml.css("fits > metadata > image > scanningSoftwareName").map(&:text)
end
table_count() click to toggle source

t.table_count(proxy: [:metadata, :document, :table_count])

# File lib/hydra/works/characterization/fits_document.rb, line 149
def table_count
  ng_xml.css("fits > metadata > document > tableCount").map(&:text)
end
track_frame_rate() click to toggle source

t.track_frame_rate(proxy: [:metadata, :video, :track, :frame_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 336
def track_frame_rate
  ng_xml.css("fits > metadata > video > track[type='video'] > frameRate").map(&:text)
end
valid() click to toggle source

t.valid(proxy: [:filestatus, :valid])

# File lib/hydra/works/characterization/fits_document.rb, line 99
def valid
  ng_xml.css("fits > filestatus > valid").map(&:text)
end
video_audio_sample_rate() click to toggle source

t.video_audio_sample_rate(proxy: [:metadata, :video, :audio_sample_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 321
def video_audio_sample_rate
  ng_xml.css("fits > metadata > video > audioSampleRate").map(&:text)
end
video_bit_rate() click to toggle source

t.video_bit_rate(proxy: [:metadata, :video, :bit_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 331
def video_bit_rate
  ng_xml.css("fits > metadata > video > bitRate").map(&:text)
end
video_duration() click to toggle source

t.video_duration(proxy: [:metadata, :video, :duration])

# File lib/hydra/works/characterization/fits_document.rb, line 311
def video_duration
  ng_xml.css("fits > metadata > video > duration").map(&:text)
end
video_height() click to toggle source

t.video_height(proxy: [:metadata, :video, :height])

# File lib/hydra/works/characterization/fits_document.rb, line 184
def video_height
  ng_xml.css("fits > metadata > video > imageHeight").map(&:text)
end
video_sample_rate() click to toggle source

t.video_sample_rate(proxy: [:metadata, :video, :sample_rate])

# File lib/hydra/works/characterization/fits_document.rb, line 316
def video_sample_rate
  ng_xml.css("fits > metadata > video > sampleRate").map(&:text)
end
video_track_height() click to toggle source

for fits 1 t.video_track_height(proxy: [:metadata, :video, :track, :height])

# File lib/hydra/works/characterization/fits_document.rb, line 196
def video_track_height
  ng_xml.css("fits > metadata > video > track[type='video'] > height").map(&:text)
end
video_track_width() click to toggle source

for fits 1 t.video_track_width(proxy: [:metadata, :video, :track, :width])

# File lib/hydra/works/characterization/fits_document.rb, line 190
def video_track_width
  ng_xml.css("fits > metadata > video > track[type='video'] > width").map(&:text)
end
video_width() click to toggle source

t.video_width(proxy: [:metadata, :video, :width])

# File lib/hydra/works/characterization/fits_document.rb, line 179
def video_width
  ng_xml.css("fits > metadata > video > imageWidth").map(&:text)
end
well_formed() click to toggle source

t.well_formed(proxy: [:filestatus, :well_formed])

# File lib/hydra/works/characterization/fits_document.rb, line 94
def well_formed
  ng_xml.css("fits > filestatus > well-formed").map(&:text)
end
width() click to toggle source

t.width(proxy: [:metadata, :image, :width])

# File lib/hydra/works/characterization/fits_document.rb, line 169
def width
  ng_xml.css("fits > metadata > image > imageWidth").map(&:text)
end
word_count() click to toggle source

t.word_count(proxy: [:metadata, :document, :word_count])

# File lib/hydra/works/characterization/fits_document.rb, line 129
def word_count
  ng_xml.css("fits > metadata > document > wordCount").map(&:text)
end