Class: VoiceML::ErrorBody
- Inherits:
-
Object
- Object
- VoiceML::ErrorBody
- Defined in:
- lib/voiceml/models/common.rb
Overview
Twilio-compatible error body. Surface only — the transport raises a VoiceML::ApiError subclass with this payload attached as ‘error.body`.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#more_info ⇒ Object
readonly
Returns the value of attribute more_info.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code: nil, message: nil, more_info: nil, status: nil) ⇒ ErrorBody
constructor
A new instance of ErrorBody.
Constructor Details
#initialize(code: nil, message: nil, more_info: nil, status: nil) ⇒ ErrorBody
Returns a new instance of ErrorBody.
30 31 32 33 34 35 |
# File 'lib/voiceml/models/common.rb', line 30 def initialize(code: nil, message: nil, more_info: nil, status: nil) @code = code @message = @more_info = more_info @status = status end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
28 29 30 |
# File 'lib/voiceml/models/common.rb', line 28 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
28 29 30 |
# File 'lib/voiceml/models/common.rb', line 28 def @message end |
#more_info ⇒ Object (readonly)
Returns the value of attribute more_info.
28 29 30 |
# File 'lib/voiceml/models/common.rb', line 28 def more_info @more_info end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28 29 30 |
# File 'lib/voiceml/models/common.rb', line 28 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/voiceml/models/common.rb', line 37 def self.from_hash(hash) return nil if hash.nil? new( code: hash['code'], message: hash['message'], more_info: hash['more_info'], status: hash['status'] ) end |