lib/cistern/formatter/formatador.rb in cistern-2.2.3 vs lib/cistern/formatter/formatador.rb in cistern-2.2.4

- old
+ new

@@ -27,18 +27,18 @@ Thread.current[:formatador] ||= Formatador.new data = "#{Thread.current[:formatador].indentation}<#{collection.class.name}\n" Thread.current[:formatador].indent do unless collection.class.attributes.empty? data << "#{Thread.current[:formatador].indentation}" - data << collection.class.attributes.map {|attribute| "#{attribute}=#{send(attribute).inspect}"}.join(",\n#{Thread.current[:formatador].indentation}") + data << collection.class.attributes.map { |attribute| "#{attribute}=#{send(attribute).inspect}" }.join(",\n#{Thread.current[:formatador].indentation}") data << "\n" end data << "#{Thread.current[:formatador].indentation}[" unless collection.empty? data << "\n" Thread.current[:formatador].indent do - data << collection.map {|member| member.inspect}.join(",\n") + data << collection.map(&:inspect).join(",\n") data << "\n" end data << Thread.current[:formatador].indentation end data << "]\n" @@ -46,8 +46,8 @@ data << "#{Thread.current[:formatador].indentation}>" data end def table(attributes = nil) - Formatador.display_table(self.map {|instance| instance.attributes}, attributes) + Formatador.display_table(map(&:attributes), attributes) end end