mirror of
https://github.com/kemko/liquid.git
synced 2026-01-04 01:05:40 +03:00
Use Integer() instead of to_i
This commit is contained in:
@@ -43,7 +43,9 @@ module Liquid
|
||||
end
|
||||
|
||||
def slice(input, offset, length=nil)
|
||||
input.to_s.slice(offset.to_i, (length || 1).to_i) || ''
|
||||
offset = Integer(offset)
|
||||
length = length ? Integer(length) : 1
|
||||
input.to_s.slice(offset, length) || ''
|
||||
end
|
||||
|
||||
# Truncate a string down to x characters
|
||||
|
||||
Reference in New Issue
Block a user