Class: ModsDisplay::Collection
- Inherits:
-
Field
- Object
- Field
- ModsDisplay::Collection
show all
- Defined in:
- lib/mods_display/fields/collection.rb
Instance Method Summary
collapse
Methods inherited from Field
#initialize, #to_html
Instance Method Details
#fields ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/mods_display/fields/collection.rb', line 7
def fields
return_fields = []
@values.each do |value|
if value.respond_to?(:titleInfo) and
value.respond_to?(:typeOfResource) and
value.typeOfResource.attributes.length > 0 and
value.typeOfResource.attributes.first.has_key?("collection") and
value.typeOfResource.attributes.first["collection"].value == "yes"
return_fields << ModsDisplay::Values.new(:label => label, :values => [value.titleInfo.text.strip])
end
end
collapse_fields(return_fields)
end
|
#label ⇒ Object
3
4
5
|
# File 'lib/mods_display/fields/collection.rb', line 3
def label
super || "Collection"
end
|