Class: RightAws::SqsGen2Interface::SqsReceiveMessageParser

Inherits:
RightAWSParser
  • Object
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:



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

def reset
  @result = []
end

#tagend(name) ⇒ Object



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

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



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

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