Sha256: fadbed74040d79dc62180a3f87eaf9417faea4ce2c34731245c4ba967f10bbdc

Contents?: true

Size: 910 Bytes

Versions: 2

Compression:

Stored size: 910 Bytes

Contents

module Vedeu

  # Provides a non-existent Vedeu::Border that acts like the real thing, but
  # does nothing.
  #
  class NullBorder

    # Returns a new instance of Vedeu::NullBorder.
    #
    # @param interface [Vedeu::Interface]
    # @return [Vedeu::NullBorder]
    def initialize(interface)
      @interface = interface
    end

    # @return [Fixnum]
    def bx
      interface.x
    end

    # @return [Fixnum]
    def bxn
      interface.xn
    end

    # @return [Fixnum]
    def by
      interface.y
    end

    # @return [Fixnum]
    def byn
      interface.yn
    end

    # @return [Fixnum]
    def height
      (by..byn).size
    end

    # @return [Array]
    def render
      []
    end

    # @return [Fixnum]
    def width
      (bx..bxn).size
    end

    private

    # @!attribute [r] interface
    # @return [Vedeu::Interface]
    attr_reader :interface

  end # NullBorder

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.13 lib/vedeu/output/null_border.rb
vedeu-0.4.12 lib/vedeu/output/null_border.rb