lib/edtf/humanize/language/default/set.rb in edtf-humanize-2.1.0 vs lib/edtf/humanize/language/default/set.rb in edtf-humanize-2.2.0
- old
+ new
@@ -29,21 +29,21 @@
mode(date) == 'inclusive' ? ' and ' : ' or '
end
def format_set_entries(dates)
dates.entries.map.with_index do |date, index|
- "#{apply_if_earlier(dates, index)}"\
- "#{apply_if_later(dates, index)}"\
- "#{apply_prefix_if_approximate(date)}"\
- "#{date_format(date)}"\
- "#{apply_suffix_if_approximate(date)}"\
+ "#{apply_if_earlier(dates, index)}" \
+ "#{apply_if_later(dates, index)}" \
+ "#{apply_prefix_if_approximate(date)}" \
+ "#{date_format(date)}" \
+ "#{apply_suffix_if_approximate(date)}" \
end
end
# '[..1760-12-03]' => on or before December 3, 1760
def apply_if_earlier(dates, index)
- return earlier_prefix(dates) if dates.earlier? && index.zero?
+ earlier_prefix(dates) if dates.earlier? && index.zero?
end
def earlier_prefix(dates)
I18n.t("edtf.terms.set_earlier_prefix_#{mode(dates)}",
default: earlier_prefix_default(dates))
@@ -53,11 +53,11 @@
mode(dates) == 'inclusive' ? 'on and before ' : 'on or before '
end
# '[1760-12..]' => on or after December 1760
def apply_if_later(dates, index)
- return later_prefix(dates) if dates.later? &&
- (index + 1) == dates.size
+ later_prefix(dates) if dates.later? &&
+ (index + 1) == dates.size
end
def later_prefix(dates)
I18n.t("edtf.terms.set_later_prefix_#{mode(dates)}",
default: later_prefix_default(dates))