Permalink
Browse files

0 bytes support for integer casting

  • Loading branch information...
1 parent 0932d41 commit 06603a53577372d1e83a747d66a689dad4ed1d3c @fl00r committed Jul 2, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/tarantool/response.rb
@@ -13,8 +13,10 @@ def to_i
data.unpack('V')[0]
when 2
data.unpack('S')[0]
+ when 0
+ nil
else
- raise ValueError.new("Unable to cast field to int: length must be 2, 4 or 8 bytes, field length is #{data.size}")
+ raise ValueError.new("Unable to cast field to int: length must be 0, 2, 4 or 8 bytes, field length is #{data.size}")
end
end

0 comments on commit 06603a5

Please sign in to comment.