Class: Awsum::Error::ErrorParser
Overview
:nodoc:
Instance Attribute Summary collapse
-
#additional ⇒ Object
readonly
Returns the value of attribute additional.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#initialize ⇒ ErrorParser
constructor
A new instance of ErrorParser.
- #tag_end(tag) ⇒ Object
- #tag_start(tag, attributes) ⇒ Object
- #text(text) ⇒ Object
Methods inherited from Parser
Constructor Details
#initialize ⇒ ErrorParser
Returns a new instance of ErrorParser.
23 24 25 26 |
# File 'lib/awsum/error.rb', line 23 def initialize @additional = {} @text = "" end |
Instance Attribute Details
#additional ⇒ Object (readonly)
Returns the value of attribute additional.
21 22 23 |
# File 'lib/awsum/error.rb', line 21 def additional @additional end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
21 22 23 |
# File 'lib/awsum/error.rb', line 21 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
21 22 23 |
# File 'lib/awsum/error.rb', line 21 def @message end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
21 22 23 |
# File 'lib/awsum/error.rb', line 21 def request_id @request_id end |
Instance Method Details
#tag_end(tag) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/awsum/error.rb', line 35 def tag_end(tag) text = @text.strip return if text.blank? case tag when 'Code' @code = text when 'Message' @message = text when 'RequestID', 'RequestId' @request_id = text else @additional[tag] = text end @text = '' end |
#tag_start(tag, attributes) ⇒ Object
28 29 |
# File 'lib/awsum/error.rb', line 28 def tag_start(tag, attributes) end |
#text(text) ⇒ Object
31 32 33 |
# File 'lib/awsum/error.rb', line 31 def text(text) @text << text unless @text.nil? end |