Exception: Bandwidth::BandwidthRateLimitErrorException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::BandwidthRateLimitErrorException
- Defined in:
- lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb
Overview
BandwidthRateLimitError class.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#field_errors ⇒ List of FieldError
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ BandwidthRateLimitErrorException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ BandwidthRateLimitErrorException
The constructor.
32 33 34 35 36 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 32 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 15 def description @description end |
#field_errors ⇒ List of FieldError
TODO: Write general description for this method
27 28 29 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 27 def field_errors @field_errors end |
#id ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 19 def id @id end |
#status ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 23 def status @status end |
#type ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 11 def type @type end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb', line 41 def unbox(hash) @type = hash['type'] @description = hash['description'] @id = hash['id'] @status = hash['status'] # Parameter is an array, so we need to iterate through it @field_errors = nil unless hash['fieldErrors'].nil? @field_errors = [] hash['fieldErrors'].each do |structure| @field_errors << (FieldError.from_hash(structure) if structure) end end end |