lib/csl/locale.rb in csl-1.5.0 vs lib/csl/locale.rb in csl-1.5.1
- old
+ new
@@ -328,13 +328,13 @@
# locale.each_term { |term| block } #-> locale
# locale.each_term #-> enumerator
#
# Calls block once for each term defined by the locale. If no block is
# given, an enumerator is returned instead.
- def each_term
+ def each_term(&block)
if block_given?
- terms.each(&Proc.new)
+ terms.each(&block)
self
else
enum_for :each_term
end
end
@@ -343,15 +343,15 @@
# locale.each_date { |date_format| block } #-> locale
# locale.each_date #-> enumerator
#
# Calls block once for each date format defined by the locale. If no
# block is given, an enumerator is returned instead.
- def each_date
+ def each_date(&block)
if block_given?
if date.is_a? CSL::Node
yield date
else
- date.each(&Proc.new)
+ date.each(&block)
end
else
enum_for :each_date
end
end