This is a little bit confusing:
invoice1 = Fortnox::API::Model::Invoice.new(customer_number: 1)
invoice2 = invoice1.update(customer_number: '1')
puts invoice1 == invoice2 # true
puts invoice1.object_id == invoice2.object_id # true
invoice1 = Fortnox::API::Model::Invoice.new(customer_number: 1)
invoice2 = invoice1.update(customer_number: 1)
puts invoice1 == invoice2 # true
puts invoice1.object_id == invoice2.object_id # false (!)
I guess this is because how the update method works:
def update(hash)
old_attributes = to_hash
new_attributes = old_attributes.merge(hash)
Here, customer_number has been converted to a String in old_attributes via it's type (Types::Sized::String[1024]) but customer_number in hash has the raw value (Integer).