Sha256: 01ccdcda5e92bad2fd2d6c2aaeea3e9c54dbe44b48c44585a8ffde5fd6f6e0d2

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

require 'vedeu/models/group'

module Vedeu

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

    class << self

      alias_method :groups, :repository

    end # Eigenclass

    real Vedeu::Group

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

  class Group

    repo Vedeu::Groups.repository

  end

end # Vedeu

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.4.54 lib/vedeu/repositories/repositories/groups.rb