Class: CiscoAclIntp::AceOtherQualifierList

Inherits:
AceSpecBase show all
Extended by:
Forwardable
Defined in:
lib/cisco_acl_intp/acespec_other_qualifiers.rb

Overview

List of other-qualifiers for extended ace

Constant Summary

Constants inherited from AccessControlContainer

CiscoAclIntp::AccessControlContainer::TERM_COLOR_TABLE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AccessControlContainer

#clean_acl_string, disable_color, #generate_tag_footer, #generate_tag_header, #generate_tagged_str, #method_missing

Constructor Details

#initialize(list = []) ⇒ AceOtherQualifierList

Constructor



19
20
21
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 19

def initialize(list = [])
  @list = list
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CiscoAclIntp::AccessControlContainer

Instance Attribute Details

#listArray

Parameters:

Returns:

  • (Array)


13
14
15
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 13

def list
  @list
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


31
32
33
34
35
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 31

def ==(other)
  @list.reduce(true) do |res, each|
    res && other.list.include?(each)
  end
end

#to_sString

Generate string for Cisco IOS access list

Returns:

  • (String)


25
26
27
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 25

def to_s
  tag_other_qualifier(@list.map(&:to_s).join(' '))
end