Class: Array
Instance Method Summary collapse
Instance Method Details
#expand_el ⇒ Object
46 47 48 |
# File 'lib/cfoo/parser.rb', line 46 def map {|element| element. } end |
#join_adjacent_strings ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/cfoo/array.rb', line 2 def join_adjacent_strings return clone if empty? self[1..-1].inject([first]) do |combined_parts, part| previous = combined_parts.pop if previous.class == String && part.class == String combined_parts << previous + part else combined_parts << previous << part end end end |