Sha256: 993521b805d740742c5e8c822cb8feb6a8c7d6701002548bdb11a24de7a275cd

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

module Vedeu

  module Null

    # Provides a non-existent model to swallow messages.
    #
    # @api private
    class Geometry

      extend Forwardable

      def_delegators :area,
                     :north,
                     :east,
                     :south,
                     :west,
                     :top,
                     :right,
                     :bottom,
                     :left,
                     :y,
                     :xn,
                     :yn,
                     :x,
                     :height,
                     :width

      # @!attribute [rw] maximised
      # @return [Boolean]
      attr_accessor :maximised

      # @!attribute [r] name
      # @return [String|NilClass]
      attr_reader :name

      # Returns a new instance of Vedeu::Null::Geometry.
      #
      # @param name [String|NilClass]
      # @return [Vedeu::Null::Geometry]
      def initialize(name = nil)
        @name      = name
        @maximised = false
      end

      # @return [FalseClass]
      def centred
        false
      end

      # @return [FalseClass]
      def maximised?
        false
      end
      alias_method :maximise, :maximised?
      alias_method :unmaximise, :maximised?

      # @return [Vedeu::Null::Geometry]
      def store
        self
      end

      private

      # @return [Vedeu::Area]
      def area
        @area ||= Vedeu::Area.from_attributes(y_default: Vedeu.height,
                                              x_default: Vedeu.width)
      end

    end # Geometry

  end # Null

end # Vedeu

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.4.48 lib/vedeu/null/geometry.rb