Class: AWS::S3::Service::Response

Inherits:
Base::Response show all
Defined in:
lib/aws/s3/response.rb

Instance Attribute Summary

Attributes inherited from Base::Response

#body, #parsed, #response

Instance Method Summary collapse

Methods inherited from Base::Response

#[], #code, #each, #error, #error?, #headers, #initialize, #inspect

Constructor Details

This class inherits a constructor from AWS::S3::Base::Response

Instance Method Details

#bucketsObject



97
98
99
100
101
102
103
104
105
# File 'lib/aws/s3/response.rb', line 97

def buckets
  if ! parsed['buckets'].nil?
    parsed['buckets']['bucket']
  elsif !  parsed['list_all_my_buckets_response']['buckets'].nil?
    parsed['list_all_my_buckets_response']['buckets']['bucket']
  else
    []
  end
end

#empty?Boolean

Returns:

  • (Boolean)


89
90
91
92
93
94
95
# File 'lib/aws/s3/response.rb', line 89

def empty?
  if parsed['buckets'].nil?
    # Walrus model
    return parsed['list_all_my_buckets_response']['buckets'].nil?
  end
  return false
end