Class: FakeSQS::ErrorResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_sqs/error_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorObject (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

#bodyObject



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

#statusObject



14
15
16
# File 'lib/fake_sqs/error_response.rb', line 14

def status
  @status ||= statuses.fetch(code)
end