Class: RightAws::S3Interface::S3AclParser

Inherits:
RightAWSParser show all
Defined in:
lib/s3/right_s3_interface.rb

Overview

:nodoc:

Constant Summary

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

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

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



1314
1315
1316
1317
# File 'lib/s3/right_s3_interface.rb', line 1314

def reset
  @result          = {:grantees=>[], :owner=>{}}
  @current_grantee = {}
end

#tagend(name) ⇒ Object



1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
# File 'lib/s3/right_s3_interface.rb', line 1321

def tagend(name)
  case name
      # service info
    when 'ID'
      if @xmlpath == 'AccessControlPolicy/Owner'
        @result[:owner][:id] = @text
      else
        @current_grantee[:id] = @text
      end
    when 'DisplayName'
      if @xmlpath == 'AccessControlPolicy/Owner'
        @result[:owner][:display_name] = @text
      else
        @current_grantee[:display_name] = @text
      end
    when 'URI'
      @current_grantee[:uri] = @text
    when 'Permission'
      @current_grantee[:permissions] = @text
    when 'Grant'
      @result[:grantees] << @current_grantee
  end
end

#tagstart(name, attributes) ⇒ Object



1318
1319
1320
# File 'lib/s3/right_s3_interface.rb', line 1318

def tagstart(name, attributes)
  @current_grantee = { :attributes => attributes } if name=='Grantee'
end