Class: FakeSQS::ErrorResponse
- Inherits:
-
Object
- Object
- FakeSQS::ErrorResponse
- Defined in:
- lib/fake_sqs/error_response.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(error) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #status ⇒ Object
Constructor Details
#initialize(error) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
10 11 12 |
# File 'lib/fake_sqs/error_response.rb', line 10 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
8 9 10 |
# File 'lib/fake_sqs/error_response.rb', line 8 def error @error end |
Instance Method Details
#body ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fake_sqs/error_response.rb', line 18 def body xml = Builder::XmlMarkup.new(:index => 4) xml.ErrorResponse do xml.Error do xml.Type type xml.Code code xml.Message error.to_s xml.Detail end xml.RequestId SecureRandom.uuid end end |
#status ⇒ Object
14 15 16 |
# File 'lib/fake_sqs/error_response.rb', line 14 def status @status ||= statuses.fetch(code) end |