Class: WscSdk::Models::Error

Inherits:
WscSdk::Model show all
Defined in:
lib/wsc_sdk/models/error.rb

Overview

A model to represent an error returned from the API.

Instance Attribute Summary

Attributes inherited from WscSdk::Model

#attributes, #changes, #data_mode, #endpoint, #errors, #partial_data

Instance Method Summary collapse

Methods inherited from WscSdk::Model

#add_error, attribute, #build_payload, #build_payload!, #clean!, #clear_primary_key, #delete, #dirty?, #has_attribute?, #ingest_attribute, #ingest_attributes, #initialize, #initialize_attributes, model_name_plural, model_name_singular, #new_model?, #primary_key, primary_key, #primary_key_attribute, #refresh, #save, #schema, schema, #valid!, #valid?, #validate

Methods included from Loggable

#logger, #logger=

Constructor Details

This class inherits a constructor from WscSdk::Model

Instance Method Details

#success?Boolean

Since this is an error response the success is always false.

Returns:

  • (Boolean)

    An indication of the status of the API call.



42
43
44
# File 'lib/wsc_sdk/models/error.rb', line 42

def success?
  @success = false
end

#to_sObject

Generates a string with the details of the error.



48
49
50
# File 'lib/wsc_sdk/models/error.rb', line 48

def to_s
  "#{code} | #{title} | #{message} | #{description}"
end