-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Run the following script
require 'gorillib/model'
class Foo
include Gorillib::Model
field :boolsy, :boolean
end
[true, false, 'true', 'false', '0', '1', 0, 1,].each do |thing|
puts [thing.inspect, Foo.receive(boolsy: thing).boolsy.to_s].join("\t")
endUsing latest Gorillib (0.5.0) I see
$ ruby bool_test.rb
true true
false false
"true" true
"false" false
"0" true
"1" true
0 true
1 true
Shouldn't the behavior be to default to interpret 0 and "0" as false and 1 and "1" as true? Or is the belief that this pattern is "not common or reliable enough to encode in a library"?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels