Sha256: ec18a78ec321f21be3434b33b00c4f3bcdf64aebe8de76abb8764dea434c6b2c

Contents?: true

Size: 1.72 KB

Versions: 28

Compression:

Stored size: 1.72 KB

Contents

module Vedeu

  module Null

    # Provides a non-existent model to swallow messages.
    #
    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 attributes [Hash<Symbol => void>]
      # @option attributes name [String|NilClass]
      # @return [Vedeu::Null::Geometry]
      def initialize(attributes = {})
        @attributes = attributes
        @name       = @attributes[:name]
        @maximised  = @attributes.fetch(:maximised, false)
      end

      # @return [FalseClass]
      def centred
        false
      end

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

      # @return [Boolean]
      def null?
        true
      end

      # @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

28 entries across 28 versions & 1 rubygems

Version Path
vedeu-0.6.4 lib/vedeu/null/geometry.rb
vedeu-0.6.3 lib/vedeu/null/geometry.rb
vedeu-0.6.2 lib/vedeu/null/geometry.rb
vedeu-0.6.1 lib/vedeu/null/geometry.rb
vedeu-0.6.0 lib/vedeu/null/geometry.rb
vedeu-0.5.13 lib/vedeu/null/geometry.rb
vedeu-0.5.12 lib/vedeu/null/geometry.rb
vedeu-0.5.11 lib/vedeu/null/geometry.rb
vedeu-0.5.10 lib/vedeu/null/geometry.rb
vedeu-0.5.9 lib/vedeu/null/geometry.rb
vedeu-0.5.8 lib/vedeu/null/geometry.rb
vedeu-0.5.7 lib/vedeu/null/geometry.rb
vedeu-0.5.6 lib/vedeu/null/geometry.rb
vedeu-0.5.5 lib/vedeu/null/geometry.rb
vedeu-0.5.4 lib/vedeu/null/geometry.rb
vedeu-0.5.3 lib/vedeu/null/geometry.rb
vedeu-0.5.2 lib/vedeu/null/geometry.rb
vedeu-0.5.1 lib/vedeu/null/geometry.rb
vedeu-0.5.0 lib/vedeu/null/geometry.rb
vedeu-0.4.65 lib/vedeu/null/geometry.rb