Like this?
```rb
names = object_names.map {|name| container ? "#{ container }/#{ name }" : name }
body = names.map {|name| URI.encode(name) }.join("\n")
```
fyi, I believe my initial code for the rackspace method was:
```rb
body = object_names.map do |name|
  URI.encode(container ? "#{ container }/#{ name }" : name)
end.join("\n")
```