Class: WorkOS::ErrorBodyWithCodeFieldErrors

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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
  @message
end