class Trizetto::Api::Eligibility::WebService::ValidationFailure
Wraps a validation error returned in the SOAP response body
Example
failure = ValidationFailure.new({affected_fields: {string: "InsuranceNum"}, message: "Please enter InsuranceNum."}`) failure.affected_fields # =>["InsuranceNum"] failure.message # => "Please enter InsuranceNum."
Attributes
affected_fields[RW]
An array of strings indicating which fields had a validation failure.
While the WSDL has this as an array, in practice, there is one field in that array
WSDL Reference
<s:element minOccurs="0" maxOccurs="1" name="AffectedFields" type="tns:ArrayOfString" />
message[RW]
The validation error associated with the affected fields
WSDL Reference
<s:element minOccurs="0" maxOccurs="1" name="Message" type="s:string" />
Public Class Methods
new(validation_failure_hash)
click to toggle source
Initialize the Validation failure from a parsed DoInquiry response hash
# File lib/trizetto/api/eligibility/web_service/validation_failure.rb, line 35 def initialize(validation_failure_hash) self.affected_fields = Array((validation_failure_hash.dig(:affected_fields) || {})[:string]) self.message = validation_failure_hash[:message] end
Public Instance Methods
to_h()
click to toggle source
# File lib/trizetto/api/eligibility/web_service/validation_failure.rb, line 40 def to_h {affected_fields: affected_fields, message: message} end