Class: ONIX::Contributor
Instance Attribute Summary
Attributes included from Attributes
#attributes
Methods inherited from SubsetDSL
element, elements, #get_class, get_class, inherited, #initialize, n, #parse, ref_to_short, register_elements, register_scopes, #register_subset_array, registered_elements, #registered_elements, registered_scopes, scope, short_to_ref
Methods inherited from Subset
parse, #parse, #tag_match, #unsupported
Methods included from Attributes
attribute_class, #parse_attributes, #serialized_attributes
Instance Method Details
#biographical_notes ⇒ Array<String>
41
|
# File 'lib/onix/contributor.rb', line 41
elements "BiographicalNote", :text, :shortcut => :biographies, :cardinality => 0..n
|
#biographies ⇒ Array<String>
41
|
# File 'lib/onix/contributor.rb', line 41
elements "BiographicalNote", :text, :shortcut => :biographies, :cardinality => 0..n
|
#biography ⇒ String
biography string with HTML
80
81
82
|
# File 'lib/onix/contributor.rb', line 80
def biography
self.biographies.first
end
|
#birth_date ⇒ Time
94
95
96
97
98
|
# File 'lib/onix/contributor.rb', line 94
def birth_date
if contributor_date = @contributor_dates.find { |d| d.role.human == "DateOfBirth" }
contributor_date.date.to_time
end
end
|
38
|
# File 'lib/onix/contributor.rb', line 38
elements "ContributorDate", :subset, :shortcut => :dates, :cardinality => 0..n
|
#contributor_descriptions ⇒ Array<String>
43
|
# File 'lib/onix/contributor.rb', line 43
elements "ContributorDescription", :text, :cardinality => 0..n
|
44
|
# File 'lib/onix/contributor.rb', line 44
elements "ContributorPlace", :subset, :shortcut => :places, :cardinality => 0..n
|
9
|
# File 'lib/onix/contributor.rb', line 9
element "ContributorRole", :subset, :shortcut => :role, :cardinality => 1..n
|
#corporate_name ⇒ String
31
|
# File 'lib/onix/contributor.rb', line 31
element "CorporateName", :text, :cardinality => 0..1
|
#corporate_name_inverted ⇒ String
32
|
# File 'lib/onix/contributor.rb', line 32
element "CorporateNameInverted", :text, :cardinality => 0..1
|
38
|
# File 'lib/onix/contributor.rb', line 38
elements "ContributorDate", :subset, :shortcut => :dates, :cardinality => 0..n
|
#death_date ⇒ Time
102
103
104
105
106
|
# File 'lib/onix/contributor.rb', line 102
def death_date
if contributor_date = @contributor_dates.find { |d| d.role.human == "DateOfDeath" }
contributor_date.date.to_time
end
end
|
#from_languages ⇒ Array<FromLanguage>
10
|
# File 'lib/onix/contributor.rb', line 10
elements "FromLanguage", :subset, :klass => "LanguageCode", :cardinality => 0..n
|
16
|
# File 'lib/onix/contributor.rb', line 16
elements "NameIdentifier", :subset, :shortcut => :identifiers, :cardinality => 0..n
|
#inverted_name ⇒ String
inverted flatten person name
74
75
76
|
# File 'lib/onix/contributor.rb', line 74
def inverted_name
person_name_inverted || corporate_name_inverted
end
|
#key_names ⇒ String
22
|
# File 'lib/onix/contributor.rb', line 22
element "KeyNames", :text, :cardinality => 0..1
|
#letters_after_names ⇒ String
25
|
# File 'lib/onix/contributor.rb', line 25
element "LettersAfterNames", :text, :cardinality => 0..1
|
#name ⇒ String
flatten person name (firstname lastname)
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/onix/contributor.rb', line 58
def name
return person_name if person_name
if key_names
if names_before_key
return "#{names_before_key} #{key_names}"
else
return key_names
end
end
corporate_name
end
|
#name_before_key ⇒ String
20
|
# File 'lib/onix/contributor.rb', line 20
element "NamesBeforeKey", :text, :shortcut => :name_before_key, :cardinality => 0..1
|
16
|
# File 'lib/onix/contributor.rb', line 16
elements "NameIdentifier", :subset, :shortcut => :identifiers, :cardinality => 0..n
|
#names_after_key ⇒ String
23
|
# File 'lib/onix/contributor.rb', line 23
element "NamesAfterKey", :text, :cardinality => 0..1
|
#names_before_key ⇒ String
20
|
# File 'lib/onix/contributor.rb', line 20
element "NamesBeforeKey", :text, :shortcut => :name_before_key, :cardinality => 0..1
|
#person_name ⇒ String
17
|
# File 'lib/onix/contributor.rb', line 17
element "PersonName", :text, :cardinality => 0..1
|
#person_name_inverted ⇒ String
18
|
# File 'lib/onix/contributor.rb', line 18
element "PersonNameInverted", :text, :cardinality => 0..1
|
49
50
51
|
# File 'lib/onix/contributor.rb', line 49
def place
self.places.first
end
|
44
|
# File 'lib/onix/contributor.rb', line 44
elements "ContributorPlace", :subset, :shortcut => :places, :cardinality => 0..n
|
#prefix_to_key ⇒ String
21
|
# File 'lib/onix/contributor.rb', line 21
element "PrefixToKey", :text, :cardinality => 0..1
|
#prizes ⇒ Array<Prize>
40
|
# File 'lib/onix/contributor.rb', line 40
elements "Prize", :subset, :cardinality => 0..n
|
39
|
# File 'lib/onix/contributor.rb', line 39
elements "ProfessionalAffiliation", :subset, :cardinality => 0..n
|
#raw_biography ⇒ String
raw biography string without HTML
86
87
88
89
90
|
# File 'lib/onix/contributor.rb', line 86
def raw_biography
if self.biography
Helper.strip_html(self.biography).gsub(/\s+/, " ")
end
end
|
9
|
# File 'lib/onix/contributor.rb', line 9
element "ContributorRole", :subset, :shortcut => :role, :cardinality => 1..n
|
#sequence_number ⇒ Integer
8
|
# File 'lib/onix/contributor.rb', line 8
element "SequenceNumber", :integer, :cardinality => 0..1
|
#suffix_to_key ⇒ String
24
|
# File 'lib/onix/contributor.rb', line 24
element "SuffixToKey", :text, :cardinality => 0..1
|
#titles_after_names ⇒ String
26
|
# File 'lib/onix/contributor.rb', line 26
element "TitlesAfterNames", :text, :cardinality => 0..1
|
#titles_before_names ⇒ String
19
|
# File 'lib/onix/contributor.rb', line 19
element "TitlesBeforeNames", :text, :cardinality => 0..1
|
#to_languages ⇒ Array<ToLanguage>
11
|
# File 'lib/onix/contributor.rb', line 11
elements "ToLanguage", :subset, :klass => "LanguageCode", :cardinality => 0..n
|
#websites ⇒ Array<Website>
42
|
# File 'lib/onix/contributor.rb', line 42
elements "Website", :subset, :cardinality => 0..n
|