class VertexClient::Payload::Invoice
Constants
- DOCUMENT_NUMBER_LIMIT
Public Instance Methods
body()
click to toggle source
Calls superclass method
# File lib/vertex_client/payloads/invoice.rb, line 13 def body super.merge({ :'@documentNumber' => params[:document_number], :'@documentDate' => params[:date] }) end
document_number_missing?()
click to toggle source
# File lib/vertex_client/payloads/invoice.rb, line 20 def document_number_missing? params[:document_number].to_s.empty? end
document_number_too_long?()
click to toggle source
# File lib/vertex_client/payloads/invoice.rb, line 24 def document_number_too_long? params[:document_number].to_s.length > DOCUMENT_NUMBER_LIMIT end
validate!()
click to toggle source
Calls superclass method
# File lib/vertex_client/payloads/invoice.rb, line 7 def validate! super raise VertexClient::ValidationError.new('document_number is required for invoice') if document_number_missing? raise VertexClient::ValidationError.new("document_number must be less than or equal to #{DOCUMENT_NUMBER_LIMIT} characters") if document_number_too_long? end