Sha256: 03d81ecf3a47c9a9c1d1b8d0234feee9659ceb69885505016c59ae1d86a05596
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
module Vedeu # Interfaces can be associated with one another by being members of the same # Group. A Group is a collection of interface names. # class Group include Vedeu::Model attr_reader :name # Return a new instance of Group. # # @param name [String] The name of the group. # @param members [Array] # @return [Group] def initialize(name, members = []) @name = name @members = Array(members) @repository = Vedeu.groups end # Add a member to the group by name. # # @param member [String] # @return [Group] def add(member) Group.new(name, members.add(member)).store end # Return the members as a Set. # # @return [Set] def members @members.to_set end # Remove a member from the group by name. # # @param member [String] # @return [Group] def remove(member) Group.new(name, members.delete(member)).store end # Remove all members from the group. # # @return [Group] def reset Group.new(name).store end private end # Group end # Vedeu
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.4.3 | lib/vedeu/models/group.rb |