Class: ComplyanceSDK::PurchaseInvoice::PurchaseInvoiceValidationErrorEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/complyance_sdk/purchase_invoice/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, message:, path:, source:) ⇒ PurchaseInvoiceValidationErrorEntry

Returns a new instance of PurchaseInvoiceValidationErrorEntry.



90
91
92
93
94
95
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 90

def initialize(code:, message:, path:, source:)
  @code = code
  @message = message
  @path = path || []
  @source = source
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



88
89
90
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 88

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



88
89
90
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 88

def message
  @message
end

#pathObject (readonly)

Returns the value of attribute path.



88
89
90
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 88

def path
  @path
end

#sourceObject (readonly)

Returns the value of attribute source.



88
89
90
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 88

def source
  @source
end

Class Method Details

.from_h(data) ⇒ Object



97
98
99
100
101
102
103
104
105
106
# File 'lib/complyance_sdk/purchase_invoice/models.rb', line 97

def self.from_h(data)
  return nil unless data.is_a?(Hash)

  new(
    code: ModelHelpers.value_for(data, :code),
    message: ModelHelpers.value_for(data, :message),
    path: ModelHelpers.value_for(data, :path) || [],
    source: ModelHelpers.value_for(data, :source)
  )
end