Class: CiscoAclIntp::NamedAcl
- Inherits:
-
AclBase
- Object
- AccessControlContainer
- AclBase
- CiscoAclIntp::NamedAcl
- Defined in:
- lib/cisco_acl_intp/acl_category_base.rb
Overview
Named ACL container base
Direct Known Subclasses
Constant Summary
Constants inherited from AclBase
Constants inherited from AccessControlContainer
AccessControlContainer::TERM_COLOR_TABLE
Instance Attribute Summary
Attributes inherited from AclBase
#acl_type, #list, #name, #name_type
Instance Method Summary collapse
-
#header_string ⇒ String
Generate ACL header string.
-
#line_string(entry) ⇒ Object
Generate ACL line string.
-
#named_acl? ⇒ Boolean
check acl type,Named ACL or not?.
-
#numbered_acl? ⇒ Boolean
check acl type, Numbered ACL or not?.
-
#to_s ⇒ String
Generate string for Cisco IOS access list.
Methods inherited from AclBase
#==, #add_entry, #clean_acl_string, #dup_with_list, #find_aces_contained, #find_aces_contains, #find_aces_with, #initialize, #renumber
Methods included from AceSearchUtility
#generate_port_obj, generate_port_obj, #port_spec_by_protocol, port_spec_by_protocol, ptkey, #ptkey, search_conditions, #search_conditions, select_proto_class, #select_proto_class, slice_contains_opts, #slice_contains_opts, #srcdst_condition, srcdst_condition, #target_ace, target_ace
Methods inherited from AccessControlContainer
#clean_acl_string, disable_color, #generate_tag_footer, #generate_tag_header, #generate_tagged_str, #method_missing
Constructor Details
This class inherits a constructor from CiscoAclIntp::AclBase
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CiscoAclIntp::AccessControlContainer
Instance Method Details
#header_string ⇒ String
Generate ACL header string
51 52 53 54 55 56 57 58 |
# File 'lib/cisco_acl_intp/acl_category_base.rb', line 51 def header_string format( '%s %s %s', tag_header('ip access-list'), tag_type(@acl_type), tag_name(@name) ) end |
#line_string(entry) ⇒ Object
Generate ACL line string
62 63 64 65 |
# File 'lib/cisco_acl_intp/acl_category_base.rb', line 62 def line_string(entry) # add indent format ' %s', clean_acl_string(entry.to_s) end |
#named_acl? ⇒ Boolean
check acl type,Named ACL or not?
39 40 41 |
# File 'lib/cisco_acl_intp/acl_category_base.rb', line 39 def named_acl? true end |
#numbered_acl? ⇒ Boolean
check acl type, Numbered ACL or not?
45 46 47 |
# File 'lib/cisco_acl_intp/acl_category_base.rb', line 45 def numbered_acl? false end |
#to_s ⇒ String
Generate string for Cisco IOS access list
69 70 71 72 73 74 |
# File 'lib/cisco_acl_intp/acl_category_base.rb', line 69 def to_s strings = @list.each_with_object([header_string]) do |entry, strlist| strlist.push line_string(entry) end strings.join("\n") end |