Sha256: 7ee716f3d338226131b5c0bfe515a5c426f09738d20b6c155c56d8245434b59e

Contents?: true

Size: 1.41 KB

Versions: 30

Compression:

Stored size: 1.41 KB

Contents

module Vedeu

  module Geometry

    # Provides a non-existent model to swallow messages.
    #
    class Null < Vedeu::Null::Generic

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

      private

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

    end # Null

  end # Geometry

end # Vedeu

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
vedeu-0.6.50 lib/vedeu/geometry/null.rb
vedeu-0.6.49 lib/vedeu/geometry/null.rb
vedeu-0.6.48 lib/vedeu/geometry/null.rb
vedeu-0.6.47 lib/vedeu/geometry/null.rb
vedeu-0.6.46 lib/vedeu/geometry/null.rb
vedeu-0.6.45 lib/vedeu/geometry/null.rb
vedeu-0.6.44 lib/vedeu/geometry/null.rb
vedeu-0.6.43 lib/vedeu/geometry/null.rb
vedeu-0.6.42 lib/vedeu/geometry/null.rb
vedeu-0.6.41 lib/vedeu/geometry/null.rb
vedeu-0.6.40 lib/vedeu/geometry/null.rb
vedeu-0.6.39 lib/vedeu/geometry/null.rb
vedeu-0.6.38 lib/vedeu/geometry/null.rb
vedeu-0.6.37 lib/vedeu/geometry/null.rb
vedeu-0.6.36 lib/vedeu/geometry/null.rb
vedeu-0.6.35 lib/vedeu/geometry/null.rb
vedeu-0.6.34 lib/vedeu/geometry/null.rb
vedeu-0.6.33 lib/vedeu/geometry/null.rb
vedeu-0.6.32 lib/vedeu/geometry/null.rb
vedeu-0.6.31 lib/vedeu/geometry/null.rb