class ONIX::ResourceVersion

Public Instance Methods

file_format() click to toggle source

@return [String]

# File lib/onix/resource_version.rb, line 23
def file_format
  if ["DownloadableFile", "LinkableResource"].include?(@resource_form.human)
    if file_format_feature
      file_format_feature.value.human
    end
  end
end
file_format_feature() click to toggle source

@return [ResourceVersionFeature]

# File lib/onix/resource_version.rb, line 18
def file_format_feature
  @resource_version_features.select { |f| f.type.human == "FileFormat" }.first
end
file_mimetype() click to toggle source
# File lib/onix/resource_version.rb, line 31
def file_mimetype
  if ["DownloadableFile", "LinkableResource"].include?(@resource_form.human)
    if file_format_feature
      file_format_feature.value.mimetype
    end
  end
end
filename() click to toggle source

@return [String]

# File lib/onix/resource_version.rb, line 11
def filename
  if @resource_form.human == "DownloadableFile"
    resource_links.first
  end
end
image_height() click to toggle source
# File lib/onix/resource_version.rb, line 57
def image_height
  if self.image_height_feature
    self.image_height_feature.value.to_i
  end
end
image_height_feature() click to toggle source
# File lib/onix/resource_version.rb, line 43
def image_height_feature
  @resource_version_features.image_pixels_height.first
end
image_width() click to toggle source
# File lib/onix/resource_version.rb, line 51
def image_width
  if self.image_width_feature
    self.image_width_feature.value.to_i
  end
end
image_width_feature() click to toggle source
# File lib/onix/resource_version.rb, line 39
def image_width_feature
  @resource_version_features.image_pixels_width.first
end
last_updated() click to toggle source
# File lib/onix/resource_version.rb, line 73
def last_updated
  if self.last_updated_content_date
    self.last_updated_content_date.date
  end
end
last_updated_content_date() click to toggle source
# File lib/onix/resource_version.rb, line 69
def last_updated_content_date
  @content_dates.last_updated.first
end
last_updated_utc() click to toggle source
# File lib/onix/resource_version.rb, line 79
def last_updated_utc
  if self.last_updated_content_date and self.last_updated_content_date.date
    self.last_updated_content_date.date.to_time.utc.strftime('%Y%m%dT%H%M%S%z')
  end
end
md5_hash() click to toggle source
# File lib/onix/resource_version.rb, line 63
def md5_hash
  if self.md5_hash_feature
    self.md5_hash_feature.value
  end
end
md5_hash_feature() click to toggle source
# File lib/onix/resource_version.rb, line 47
def md5_hash_feature
  @resource_version_features.md5_hash.first
end