This can be re-written to take advantage of Ruby's implicit returns, for example:

body = @connect.describe_auto_scaling_groups('AutoScalingGroupNames' => [asg]).body
result = body['DescribeAutoScalingGroupsResult']['AutoScalingGroups'].last
result['Instances'].map { |info| info['InstanceId'] }