Sha256: bea2b38bd359242b48d531833a5e193f674f17a932a83362b5e57a055f8bf499

Contents?: true

Size: 1.03 KB

Versions: 19

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Vedeu

  module Cells

    # Provides the character/escape sequence to draw one cell of a
    # border with a custom value, colour and style.
    #
    # @api private
    #
    class Border < Vedeu::Cells::Empty

      extend Forwardable

      def_delegators :geometry,
                     :x,
                     :xn,
                     :y,
                     :yn

      # @return [Hash<Symbol => void>]
      def attributes
        {
          colour: colour,
          name:   @name,
          style:  style,
        }
      end

      # @param value [String|Symbol]
      # @return [Vedeu::Cells::Border]
      def name=(value)
        @name = value

        self
      end

      # @return [Symbol]
      def type
        :border
      end

      # @return [String]
      def value
        return '' unless present?(@value)

        Vedeu.esc.border { @value }
      end

      private

      # @macro defaults_method
      def defaults
        super
      end

    end # Border

  end # Cells

end # Vedeu

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vedeu-0.8.32 lib/vedeu/cells/border.rb
vedeu-0.8.31 lib/vedeu/cells/border.rb
vedeu-0.8.30 lib/vedeu/cells/border.rb
vedeu-0.8.29 lib/vedeu/cells/border.rb
vedeu-0.8.28 lib/vedeu/cells/border.rb
vedeu-0.8.27 lib/vedeu/cells/border.rb
vedeu-0.8.26 lib/vedeu/cells/border.rb
vedeu-0.8.25 lib/vedeu/cells/border.rb
vedeu-0.8.24 lib/vedeu/cells/border.rb
vedeu-0.8.23 lib/vedeu/cells/border.rb
vedeu-0.8.22 lib/vedeu/cells/border.rb
vedeu-0.8.21 lib/vedeu/cells/border.rb
vedeu-0.8.20 lib/vedeu/cells/border.rb
vedeu-0.8.19 lib/vedeu/cells/border.rb
vedeu-0.8.18 lib/vedeu/cells/border.rb
vedeu-0.8.17 lib/vedeu/cells/border.rb
vedeu-0.8.16 lib/vedeu/cells/border.rb
vedeu-0.8.15 lib/vedeu/cells/border.rb
vedeu-0.8.14 lib/vedeu/cells/border.rb