Skip to content

Commit

Permalink
Merge pull request #147 from sul-dlss/edition-public-method
Browse files Browse the repository at this point in the history
Imprint.edition_vals_str method made public for mods_display gem
  • Loading branch information
justinlittman authored Dec 1, 2023
2 parents 4af4b5e + 31d9470 commit b98fb35
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/stanford-mods/imprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def dates(date_field_keys = [:dateIssued, :dateCreated, :dateCaptured, :copyrigh
end.compact.flatten
end

# called by mods_display gem, so made public
# called by mods_display gem
def publisher_vals_str
return if element.publisher.text.strip.empty?

Expand All @@ -56,6 +56,13 @@ def publisher_vals_str
compact_and_join_with_delimiter(publishers, ' : ')
end

# called by mods_display gem
def edition_vals_str
element.edition.reject do |e|
e.text.strip.empty?
end.map(&:text).join(' ').strip
end

private

def compact_and_join_with_delimiter(values, delimiter)
Expand All @@ -77,12 +84,6 @@ def ends_in_terminating_punctuation?(value)
value.strip.end_with?('.', ',', ':', ';')
end

def edition_vals_str
element.edition.reject do |e|
e.text.strip.empty?
end.map(&:text).join(' ').strip
end

# PLACE processing methods ------

def place_vals_str
Expand Down

0 comments on commit b98fb35

Please sign in to comment.