church 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/church/io.rb +8 -0
- data/lib/church/utils.rb +1 -0
- data/lib/church/version.rb +1 -1
- data/spec/io_spec.rb +7 -0
- metadata +1 -1
data/lib/church/io.rb
CHANGED
@@ -29,4 +29,12 @@ module Church
|
|
29
29
|
|
30
30
|
# Joins the collection into a string on a specified delimiter
|
31
31
|
JOIN = -> coll, delim { coll * delim }
|
32
|
+
|
33
|
+
# Converts its string argument to a number
|
34
|
+
TO_I = -> str {
|
35
|
+
(to_i = -> i {
|
36
|
+
i = i * 10 + ORD[str[0]] - ORD['0']
|
37
|
+
(str = str[1..-1]) == '' ? i : to_i[i]
|
38
|
+
})[0]
|
39
|
+
}
|
32
40
|
end
|
data/lib/church/utils.rb
CHANGED
data/lib/church/version.rb
CHANGED
data/spec/io_spec.rb
CHANGED