Sha256: 7b9c49a084fc79b840e001c6223eba1658e6e80f9bf3570c892a29001062a980

Contents?: true

Size: 784 Bytes

Versions: 11

Compression:

Stored size: 784 Bytes

Contents

module Vedeu

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

    class << self

      # @example
      #   Vedeu.groups
      #
      # @return [Vedeu::Groups]
      alias_method :groups, :repository

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

    end

    # @example
    #   Vedeu.groups.by_name('name')
    #
    # @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

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.4.44 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.43 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.42 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.41 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.40 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.39 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.38 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.37 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.36 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.35 lib/vedeu/repositories/repositories/groups.rb
vedeu-0.4.34 lib/vedeu/repositories/repositories/groups.rb