Class: ONIX::ResourceVersion
Instance Method Summary
collapse
Methods inherited from SubsetDSL
_ancestor_registered_scopes, _ancestors_registered_elements, ancestor_registered_scopes, ancestors_registered_elements, element, elements, get_class, #initialize, #parse, ref_to_short, registered_elements, registered_scopes, scope, short_to_ref, #unsupported
Methods inherited from Subset
parse, #parse, tag_match, #tag_match, #unsupported
Instance Method Details
#features ⇒ Object
49
50
51
|
# File 'lib/onix/supporting_resource.rb', line 49
def features
@resource_version_features
end
|
63
64
65
66
67
68
69
|
# File 'lib/onix/supporting_resource.rb', line 63
def file_format
if ["DownloadableFile", "LinkableResource"].include?(@resource_form.human)
if file_format_feature
file_format_feature.value.human
end
end
end
|
59
60
61
|
# File 'lib/onix/supporting_resource.rb', line 59
def file_format_feature
@resource_version_features.select { |f| f.type.human=="FileFormat" }.first
end
|
#file_mimetype ⇒ Object
71
72
73
74
75
76
77
|
# File 'lib/onix/supporting_resource.rb', line 71
def file_mimetype
if ["DownloadableFile", "LinkableResource"].include?(@resource_form.human)
if file_format_feature
file_format_feature.value.mimetype
end
end
end
|
#filename ⇒ Object
53
54
55
56
57
|
# File 'lib/onix/supporting_resource.rb', line 53
def filename
if @resource_form.human=="DownloadableFile"
@resource_links.first
end
end
|
41
42
43
|
# File 'lib/onix/supporting_resource.rb', line 41
def form
@resource_form
end
|
#image_height ⇒ Object
97
98
99
100
101
|
# File 'lib/onix/supporting_resource.rb', line 97
def image_height
if self.image_height_feature
self.image_height_feature.value.to_i
end
end
|
#image_height_feature ⇒ Object
83
84
85
|
# File 'lib/onix/supporting_resource.rb', line 83
def image_height_feature
@resource_version_features.image_pixels_height.first
end
|
#image_width ⇒ Object
91
92
93
94
95
|
# File 'lib/onix/supporting_resource.rb', line 91
def image_width
if self.image_width_feature
self.image_width_feature.value.to_i
end
end
|
#image_width_feature ⇒ Object
79
80
81
|
# File 'lib/onix/supporting_resource.rb', line 79
def image_width_feature
@resource_version_features.image_pixels_width.first
end
|
#last_updated ⇒ Object
113
114
115
116
117
|
# File 'lib/onix/supporting_resource.rb', line 113
def last_updated
if self.last_updated_content_date
self.last_updated_content_date.date
end
end
|
#last_updated_content_date ⇒ Object
109
110
111
|
# File 'lib/onix/supporting_resource.rb', line 109
def last_updated_content_date
@content_dates.last_updated.first
end
|
#last_updated_utc ⇒ Object
119
120
121
122
123
|
# File 'lib/onix/supporting_resource.rb', line 119
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
|
#links ⇒ Object
45
46
47
|
# File 'lib/onix/supporting_resource.rb', line 45
def links
@resource_links
end
|
#md5_hash ⇒ Object
103
104
105
106
107
|
# File 'lib/onix/supporting_resource.rb', line 103
def md5_hash
if self.md5_hash_feature
self.md5_hash_feature.value
end
end
|
#md5_hash_feature ⇒ Object
87
88
89
|
# File 'lib/onix/supporting_resource.rb', line 87
def md5_hash_feature
@resource_version_features.md5_hash.first
end
|