Sha256: f08ecd703e19f01c0cdb3f3ae206d6c4c06f549fa69641dbebf7ac5285651862

Contents?: true

Size: 615 Bytes

Versions: 2

Compression:

Stored size: 615 Bytes

Contents

module Lumos
  module Formatters
    class Surround < Lumos::Formatters::Base
      def result
        horizontal_result
      end

    private

      def horizontal_pattern
        "#{delimiter * chopped_message_length}"\
        "#{padding > 0 ? (delimiter * padding) * 2 : nil}"\
        "#{delimiter * 2}"
      end

      def horizontal_padding
        "#{content_paragraph(" " * chopped_message_length)}\n" * padding if padding > 0
      end

      def content_paragraph(line)
        "#{delimiter}#{vertical_padding}#{line}#{vertical_padding}#{chopping_padding line}#{delimiter}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lumos-0.0.2 lib/lumos/formatters/surround.rb
lumos-0.0.1 lib/lumos/formatters/surround.rb