Exception: FakeDynamo::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/fake_dynamo/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail = '') ⇒ Error

Returns a new instance of Error.



11
12
13
14
# File 'lib/fake_dynamo/exceptions.rb', line 11

def initialize(detail='')
  @detail = detail
  super(detail)
end

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail.



9
10
11
# File 'lib/fake_dynamo/exceptions.rb', line 9

def detail
  @detail
end

Instance Method Details

#class_nameObject



23
24
25
# File 'lib/fake_dynamo/exceptions.rb', line 23

def class_name
  self.class.name.split('::').last
end

#responseObject



16
17
18
19
20
21
# File 'lib/fake_dynamo/exceptions.rb', line 16

def response
  {
    '__type' => "#{self.class.type}##{class_name}",
    'message' => "#{self.class.description}: #{@detail}"
  }
end

#statusObject



27
28
29
# File 'lib/fake_dynamo/exceptions.rb', line 27

def status
  self.class.status
end