Sha256: 942c802cc09e71ed9ac386a3a7c6b9942ac29fc3626031fae311c77ac07397e3
Contents?: true
Size: 1008 Bytes
Versions: 1
Compression:
Stored size: 1008 Bytes
Contents
# coding: utf-8 module ThinReports module Core::Shape::Tblock # @private class Formatter::Padding < Formatter::Basic private ruby_18 do def apply_format_to(value) strs = in_utf8 { value.to_s.split(//) } pad_len = format.format_padding_length if pad_len > strs.size pad_strs = format.format_padding_char * (pad_len - strs.size) if format.format_padding_rdir? strs.to_s + pad_strs else pad_strs + strs.to_s end else value.to_s end end end ruby_19 do def apply_format_to(value) value.to_s.send(format.format_padding_rdir? ? :ljust : :rjust, format.format_padding_length, format.format_padding_char) end end def applicable?(value) !format.format_padding_char.blank? && format.format_padding_length > 0 end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
thinreports-0.6.0.pre3 | lib/thinreports/core/shape/tblock/formatter/padding.rb |