Sha256: 20162057b248a8e71ef5101d35ede97def6546d6251c3922fa56e0c95c4ef631

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

module Rdpl
  class Box
    attr_writer :bottom_and_top_thickness, :sides_thickness

    DEFAULT_CHARACTER = 'b'

    include LinesAndBoxes

    def bottom_and_top_thickness
      @bottom_and_top_thickness || 0
    end

    def sides_thickness
      @sides_thickness || 0
    end

    def data
      DEFAULT_CHARACTER + 
      formatted_horizontal_width + 
      formatted_vertical_width +
      formatted_bottom_and_top_thickness + 
      formatted_sides_thickness
    end

    private
    def formatted_bottom_and_top_thickness
      '%04d' % normalize_number(bottom_and_top_thickness)
    end

    def formatted_sides_thickness
      '%04d' % normalize_number(sides_thickness)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdpl-0.2.0 lib/elements/box.rb
rdpl-0.1.0 lib/elements/box.rb