Sha256: cec5af3dfd11583d0bc5771e03270f5c596f012047dc24e4d4c8ff0cf41f7095

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

module Vedeu

  # Allows the storing of view groups.
  class Groups < Repository

    class << self

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

      # Remove all stored models from the repository.
      #
      # @return [Vedeu::Groups]
      def reset!
        @groups = register(Vedeu::Group)
      end

    end

    # @param name [String] The name of the stored group.
    # @return [Vedeu::Group]
    def by_name(name)
      if registered?(name)
        find(name)

      else
        Vedeu::Group.new(name: name).store

      end
    end

  end # Groups

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.25 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.24 lib/vedeu/repositories/repositories/groups.rb