lib/gruff/measurements.rb
# Returns the longest string from a list of strings
Returns the longest string from a list of strings
Returns the longest string from a list of strings
def longest_string(list)
      list.values.inject('') { |value, memo|
	(value.to_s.length > memo.to_s.length) ? value : memo
      }
    end
def longest_string ( list ) list . values . inject ( '' ) { | value , memo | ( value . to_s . length > memo . to_s . length ) ? value : memo } end
Returns the longest string from a list of strings
Returns the longest string from a list of strings
list
<not_specific>