Class: WorkOS::ErrorBodyWithCodeFieldErrors
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::ErrorBodyWithCodeFieldErrors
- Defined in:
- lib/workos/shared/error_body_with_code_field_errors.rb
Constant Summary collapse
- HASH_ATTRS =
{ message: :message, errors: :errors }.freeze
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(json) ⇒ ErrorBodyWithCodeFieldErrors
constructor
A new instance of ErrorBodyWithCodeFieldErrors.
Constructor Details
#initialize(json) ⇒ ErrorBodyWithCodeFieldErrors
Returns a new instance of ErrorBodyWithCodeFieldErrors.
16 17 18 19 20 |
# File 'lib/workos/shared/error_body_with_code_field_errors.rb', line 16 def initialize(json) hash = self.class.normalize(json) @message = hash[:message] @errors = (hash[:errors] || []).map { |item| item ? WorkOS::ErrorBodyWithCodeFieldError.new(item) : nil } end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
12 13 14 |
# File 'lib/workos/shared/error_body_with_code_field_errors.rb', line 12 def errors @errors end |
#message ⇒ Object
Returns the value of attribute message.
12 13 14 |
# File 'lib/workos/shared/error_body_with_code_field_errors.rb', line 12 def @message end |