Sha256: d66a7f37435dc24aba34cb89bb0dc6613e461f0ec3c7fa107cdd2f5701b759dc

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

module Vedeu

  module Clear

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

      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::Group.
      #
      # @param name [String]
      # @return [Vedeu::Clear::Group]
      def initialize(name)
        @name = name
      end

      # @return [void]
      def render
        members.each { |name| Vedeu::Clear::Interface.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.19 lib/vedeu/output/clear/group.rb
vedeu-0.6.18 lib/vedeu/output/clear/group.rb
vedeu-0.6.17 lib/vedeu/output/clear/group.rb
vedeu-0.6.16 lib/vedeu/output/clear/group.rb