Class: S3::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/s3/error_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, attributes = nil) ⇒ ErrorResult

Returns a new instance of ErrorResult.



5
6
7
8
9
10
11
12
13
14
# File 'lib/s3/error_result.rb', line 5

def initialize( status_code, attributes = nil )
  @error_type, @error_description = status_code_to_error( status_code )

  if attributes.is_a?( Hash )
    @error_code = attributes[ :code ]
    @error_description = attributes[ :message ] if attributes[ :message ]
    @request_id = attributes[ :request_id ]
    @resource = attributes[ :resource ]
  end
end

Instance Attribute Details

#error_code ⇒ Object (readonly)

Returns the value of attribute error_code.



3
4
5
# File 'lib/s3/error_result.rb', line 3

def error_code
  @error_code
end

#error_description ⇒ Object (readonly)

Returns the value of attribute error_description.



3
4
5
# File 'lib/s3/error_result.rb', line 3

def error_description
  @error_description
end

#error_type ⇒ Object (readonly)

Returns the value of attribute error_type.



3
4
5
# File 'lib/s3/error_result.rb', line 3

def error_type
  @error_type
end

#request_id ⇒ Object (readonly)

Returns the value of attribute request_id.



3
4
5
# File 'lib/s3/error_result.rb', line 3

def request_id
  @request_id
end

#resource ⇒ Object (readonly)

Returns the value of attribute resource.



3
4
5
# File 'lib/s3/error_result.rb', line 3

def resource
  @resource
end

Instance Method Details

#success? ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/s3/error_result.rb', line 16

def success?
  false
end