Class: RightAws::SqsGen2Interface::SqsReceiveMessageParser

Inherits:
RightAWSParser show all
Defined in:
lib/sqs/right_sqs_gen2_interface.rb

Overview


PARSERS: Messages

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

:nodoc:



485
486
487
# File 'lib/sqs/right_sqs_gen2_interface.rb', line 485

def reset
  @result = []
end

#tagend(name) ⇒ Object



497
498
499
500
501
502
503
504
505
506
507
# File 'lib/sqs/right_sqs_gen2_interface.rb', line 497

def tagend(name)
  case name
  when 'MessageId'     then @current_message['MessageId']     = @text
  when 'ReceiptHandle' then @current_message['ReceiptHandle'] = @text
  when 'MD5OfBody'     then @current_message['MD5OfBody']     = @text
  when 'Name'          then @current_attribute_name  = @text
  when 'Value'         then @current_attribute_value = @text
  when 'Attribute'     then @current_message['Attributes'][@current_attribute_name] = @current_attribute_value
  when 'Body'          then @current_message['Body'] = @text; @result << @current_message
  end
end

#tagstart(name, attributes) ⇒ Object



488
489
490
491
492
493
494
495
496
# File 'lib/sqs/right_sqs_gen2_interface.rb', line 488

def tagstart(name, attributes)
  case name
  when 'Message' then @current_message = { }
  when 'Attribute' then
    @current_message['Attributes'] ||= {}
    @current_attribute_name  = ''
    @current_attribute_value = ''
  end
end