1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

more cleanup around bin/fog usage and messaging

This commit is contained in:
geemus (Wesley Beary) 2010-02-15 17:15:56 -08:00
parent aac4131c37
commit 72551a87d7
5 changed files with 67 additions and 60 deletions

View file

@ -73,17 +73,20 @@ module Fog
data = "#{Thread.current[:formatador].indentation}<#{self.class.name}\n"
Thread.current[:formatador].indent do
unless self.class.attributes.empty?
data << "#{Thread.current[:formatador].indentation}\n"
data << "#{Thread.current[:formatador].indentation}"
data << self.class.attributes.map {|attribute| "#{attribute}=#{send(attribute).inspect}"}.join(",\n#{Thread.current[:formatador].indentation}")
data << "\n"
end
data << "#{Thread.current[:formatador].indentation}[\n"
data << "#{Thread.current[:formatador].indentation}["
unless self.empty?
data << "\n"
Thread.current[:formatador].indent do
data << self.map {|member| member.inspect}.join(",\n")
data << "\n"
end
data << Thread.current[:formatador].indentation
end
data << "#{Thread.current[:formatador].indentation}]\n"
data << "]\n"
end
data << "#{Thread.current[:formatador].indentation}>"
data