limit(limit)
public
Limits the byte size of the string to
a number of bytes without breaking characters. Usable when the storage for
a string is limited for some reason.
'ããã«ã¡ã¯'.mb_chars.limit(7).to_s
# File activesupport/lib/active_support/multibyte/chars.rb, line 124
def limit(limit)
truncate_bytes(limit, omission: nil)
end