def hello
final_hash = Hash.new
list.each do |properties|
properties_name = properties.name
case properties.format
when :a
final_hash[properties_name] = 'xxx'
when :b
final_hash[properties_name] = 'yyy'
when :c
final_hash[properties_name] = 'zzz'
end
end
final_hash
end
这样的代码有办法变得更好看点嘛?