tainbox
tainbox copied to clipboard
Fix converting in Integer type
From documentation about Kernel#Integer:
If arg is a String, when base is omitted or equals zero, radix indicators (0, 0b, and 0x) are honored.
So, usually, when a string is converted to a number, assumed that the string has a decimal number system But now:
class Test
include Tainbox
attribute :age, :Integer
end
t = Test.new(age: "012")
p t.age #=> 10