class ShipCompliant::ErrorResult

Public Instance Methods

code() click to toggle source

Gets the error code as an integer.

puts "ERROR ##{error.code}" #=> 404
# File lib/ship_compliant/error_result.rb, line 7
def code
  error[:code].to_i
end
key() click to toggle source

Gets the key of the item with an error.

puts error.key #=> 'ORDER-123'
# File lib/ship_compliant/error_result.rb, line 14
def key
  error[:key]
end
message() click to toggle source

Gets the error message.

puts "ERROR: #{error.message}" #=> 'I don't think it's a good idea,
Yogi'
# File lib/ship_compliant/error_result.rb, line 22
def message
  error[:message]
end
target() click to toggle source

The object type that had the error.

puts error.target #=> 'SalesOrder'
# File lib/ship_compliant/error_result.rb, line 29
def target
  error[:target]
end
type() click to toggle source

The type of error that occured.

puts error.type #=> 'Validation'
# File lib/ship_compliant/error_result.rb, line 36
def type
  error[:type]
end