Sha256: 4b996f0f4179b00767d4f6e3ef0b47a8abf82d0317c46eb73bf975864519f5f3

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

module Vedeu

  # Provides the mechanisms to clear an interface or group of interfaces.
  #
  module Clear

    # Clear the interfaces belonging to the named group.
    #
    class NamedGroup

      class << self

        # Clears the group of interfaces belonging to the given name.
        #
        # @example
        #   Vedeu.clear_by_group(name)
        #
        # @param name [String]
        # @return [void]
        def render(name)
          new(name).render
        end
        alias_method :clear_by_group, :render
        alias_method :by_group, :render

      end # Eigenclass

      # Return a new instance of Vedeu::Clear::NamedGroup.
      #
      # @param name [String]
      # @return [Vedeu::Clear::NamedGroup]
      def initialize(name)
        @name = name
      end

      # @return [void]
      def render
        members.each { |name| Vedeu::Clear::NamedInterface.render(name) }
      end

      protected

      # @!attribute [r] name
      # @return [String]
      attr_reader :name

      private

      # @return [Array<String>]
      def members
        Vedeu.groups.by_name(name).members
      end

    end # Group

  end # Clear

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.6.10 lib/vedeu/output/clear/named_group.rb
vedeu-0.6.9 lib/vedeu/output/clear/named_group.rb
vedeu-0.6.8 lib/vedeu/output/clear/named_group.rb
vedeu-0.6.7 lib/vedeu/output/clear/named_group.rb