Class: Talkbird::Result::Exception

Inherits:
Object
  • Object
show all
Defined in:
lib/talkbird/result/exception.rb

Overview

Class representing a result as an exception.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, result) ⇒ Exception

Returns a new instance of Exception.



12
13
14
15
16
# File 'lib/talkbird/result/exception.rb', line 12

def initialize(exception, result)
  @result = result
  @exception = exception
  @body = { error: exception.message }
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/talkbird/result/exception.rb', line 8

def body
  @body
end

#exceptionObject (readonly)

Returns the value of attribute exception.



10
11
12
# File 'lib/talkbird/result/exception.rb', line 10

def exception
  @exception
end

#resultObject (readonly)

Returns the value of attribute result.



9
10
11
# File 'lib/talkbird/result/exception.rb', line 9

def result
  @result
end