Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix enum type error (#285)

authored by

barseek and committed by
GitHub
a97da9b4 b4bec960

+2 -3
+2 -3
lib/literal/enum.rb
··· 71 71 raise ArgumentError.new("You can only use `find_by` on unique indexes.") 72 72 end 73 73 74 - unless (type = @indexes_definitions.fetch(key)[0]) === value 75 - raise Literal::TypeError.expected(value, to_be_a: type) 76 - end 74 + type = @indexes_definitions.fetch(key)[0] 75 + Literal.check(actual: value, expected: type) 77 76 78 77 @indexes.fetch(key)[value]&.first 79 78 end