Sha256: 86c6a6abfd5fa4cb9d9b0f6f32bd113dd56a97a997b9a85fa7f91396adc2506c

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

module Vedeu

  # Allows the storing of interface/view geometry independent of the interface
  # instance.
  #
  class Geometries < Repository

    class << self

      # @return [Vedeu::Geometries]
      def geometries
        @geometries ||= reset!
      end
      alias_method :repository, :geometries

      # @return [Vedeu::Geometries]
      def reset!
        @geometries = Vedeu::Geometries.register_repository(Vedeu::Geometry)
      end

    end

    # @param name [String] The name of the stored geometry.
    # @return [Vedeu::Geometry|Vedeu::NullGeometry]
    def by_name(name)
      if registered?(name)
        find(name)

      else
        Vedeu::NullGeometry.new(name)

      end
    end

  end # Geometries

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.17 lib/vedeu/repositories/repositories/geometries.rb
vedeu-0.4.16 lib/vedeu/repositories/repositories/geometries.rb