Class: Aws::S3Interface::S3ListBucketParser

Inherits:
AwsParser 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



1039
1040
1041
1042
1043
# File 'lib/s3/s3_interface.rb', line 1039

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

#tagend(name) ⇒ Object



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/s3/s3_interface.rb', line 1049

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



1045
1046
1047
# File 'lib/s3/s3_interface.rb', line 1045

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