Class: Conpar::Directive::AccessList::Remark

Inherits:
Base
  • Object
show all
Defined in:
lib/conpar/directive/access_list/remark.rb

Overview

Constant Summary collapse

SIGNATURE =
/^(access-list)\b.*\b(remark)\b/i

Constants inherited from Base

Base::NAME

Instance Attribute Summary

Attributes inherited from Base

#content, #ilk, #line_number, #line_span, #match_data, #rule, #sub_ilk

Instance Method Summary collapse

Methods inherited from Base

#to_s

Constructor Details

#initialize(content = "", options = {}) ⇒ Remark

Returns a new instance of Remark


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/conpar/directive/access_list/remark.rb', line 9

def initialize(content="", options={})
  super
  @sub_ilk = "remark"

  # access-list access_list_name remark remark_content
  parse_regex = %r/^
    (access-list)\s* # Directive Signature
    (?<name>#{NAME})\s* # ACL Name
    (?<type>remark)\s* # ACL Type
    (?<remark>.+) # Everything else on line
  $/x
  @match_data = parse_regex.match(@content)
end