Sha256: 4b4bc4894febbbd452a6b32f4eb1e02bf412479b28b3d30d82f432cc1beebfa0

Contents?: true

Size: 707 Bytes

Versions: 5

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

module Thinreports
  module BasicReport
    module Core
      module Shape
        module TextBlock
          module Formatter
            class Padding < Formatter::Basic
              private

              def apply_format_to(value)
                value.to_s.send(format.format_padding_rdir? ? :ljust : :rjust,
                                format.format_padding_length,
                                format.format_padding_char)
              end

              def applicable?(_value)
                !blank_value?(format.format_padding_char) && format.format_padding_length > 0
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinreports-0.14.2 lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
thinreports-0.14.1 lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
thinreports-0.14.0 lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
thinreports-0.13.1 lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb
thinreports-0.13.0 lib/thinreports/basic_report/core/shape/text_block/formatter/padding.rb