Class: Aws::S3Interface::S3ListBucketParser

Inherits:
AwsParser
  • Object
show all
Defined in:
lib/s3/s3_interface.rb

Overview

:nodoc:

Constant Summary

Constants inherited from AwsParser

AwsParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from AwsParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from AwsParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from Aws::AwsParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aws::AwsParser

Instance Method Details

#resetObject



1162
1163
1164
1165
1166
# File 'lib/s3/s3_interface.rb', line 1162

def reset
  @result      = []
  @service     = {}
  @current_key = {}
end

#tagend(name) ⇒ Object



1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
# File 'lib/s3/s3_interface.rb', line 1172

def tagend(name)
  case name
    # service info
    when 'Name';
      @service['name'] = @text
    when 'Prefix';
      @service['prefix'] = @text
    when 'Marker';
      @service['marker'] = @text
    when 'MaxKeys';
      @service['max-keys'] = @text
    when 'Delimiter';
      @service['delimiter'] = @text
    when 'IsTruncated';
      @service['is_truncated'] = (@text =~ /false/ ? false : true)
    # key data
    when 'Key';
      @current_key[:key] = @text
    when 'LastModified';
      @current_key[:last_modified] = @text
    when 'ETag';
      @current_key[:e_tag] = @text
    when 'Size';
      @current_key[:size] = @text.to_i
    when 'StorageClass';
      @current_key[:storage_class] = @text
    when 'ID';
      @current_key[:owner_id] = @text
    when 'DisplayName';
      @current_key[:owner_display_name] = @text
    when 'Contents';
      @current_key[:service] = @service; @result << @current_key
  end
end

#tagstart(name, attributes) ⇒ Object



1168
1169
1170
# File 'lib/s3/s3_interface.rb', line 1168

def tagstart(name, attributes)
  @current_key = {} if name == 'Contents'
end