Class: WorkOS::ErrorBodyWithCodeInstancePathErrors

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/shared/error_body_with_code_instance_path_errors.rb

Constant Summary collapse

HASH_ATTRS =
{
  errors: :errors,
  message: :message,
  code: :code
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ErrorBodyWithCodeInstancePathErrors

Returns a new instance of ErrorBodyWithCodeInstancePathErrors.



18
19
20
21
22
23
# File 'lib/workos/shared/error_body_with_code_instance_path_errors.rb', line 18

def initialize(json)
  hash = self.class.normalize(json)
  @errors = (hash[:errors] || []).map { |item| item ? WorkOS::ErrorBodyWithCodeInstancePathError.new(item) : nil }
  @message = hash[:message]
  @code = hash[:code]
end

Instance Attribute Details

#code ⇒ Object

Returns the value of attribute code.



13
14
15
# File 'lib/workos/shared/error_body_with_code_instance_path_errors.rb', line 13

def code
  @code
end

#errors ⇒ Object

Returns the value of attribute errors.



13
14
15
# File 'lib/workos/shared/error_body_with_code_instance_path_errors.rb', line 13

def errors
  @errors
end

#message ⇒ Object

Returns the value of attribute message.



13
14
15
# File 'lib/workos/shared/error_body_with_code_instance_path_errors.rb', line 13

def message
  @message
end