From 64dfdccbc0a136aab15c53ef0375244a28895429 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 19 Mar 2015 18:38:21 -0400 Subject: d: ao & elsewhere, use of map & select --- lib/sisu/develop/ao_hash_digest.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/sisu/develop/ao_hash_digest.rb') diff --git a/lib/sisu/develop/ao_hash_digest.rb b/lib/sisu/develop/ao_hash_digest.rb index 97087a2a..39f34f85 100644 --- a/lib/sisu/develop/ao_hash_digest.rb +++ b/lib/sisu/develop/ao_hash_digest.rb @@ -103,9 +103,8 @@ module SiSU_AO_Hash #use md5 or to create hash of each ao object including ocn, & add into to each ao object end def endnote_digest(data) - t_o_bit=[] - data.each do |en_plus| - t_o_bit <<= case en_plus + data.each.map do |en_plus| + case en_plus when /#{Mx[:en_a_o]}|#{Mx[:en_b_o]}/ if en_plus =~/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/ t_o_txt,en_open,en_txt,en_close= @@ -133,8 +132,7 @@ module SiSU_AO_Hash end else en_plus end - end - t_o_bit.join + end.join end def stamped(t_o,hash_class) #decide what hash information is most useful, is compromise necessary? t_o.obj=SiSU_TextRepresentation::Alter.new(t_o).strip_clean_of_extra_spaces -- cgit v1.2.3