Sha256: e23b621457f5da05fa9fd747e78adaf5560b5aa1052263fb18e120a64350e8f6
Contents?: true
Size: 559 Bytes
Versions: 76
Compression:
Stored size: 559 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Formatters module Numbers class Base def interpolate(string, value, orientation = :right) value = value.to_s length = value.length start = orientation == :left ? 0 : -length string = string.dup string = string.ljust(length, '#') if string.length < length string[start, length] = value string.gsub('#', '') end end end end end
Version data entries
76 entries across 76 versions & 3 rubygems