Class: Conpar::Directive::AccessList::WebType

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

Overview

Constant Summary collapse

SIGNATURE =

(0.1.4) “webtype” should be followed by “permit” or “deny”

/^(access-list)\b.*\s(webtype)\s+(permit|deny)/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 = {}) ⇒ WebType

Returns a new instance of WebType.


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/conpar/directive/access_list/web_type.rb', line 10

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

  @sub_ilk = "webtype"

  parse_regex = %r/^
    (access-list)\s*                 # Directive Signature
    (?<name>#{NAME})\s*              # ACL name
    (?<type>(webtype))\s*            # Webtype ACL Type
    (?<permission>(permit|deny))?\s* # permit or deny
    (?<rule>.+)                      # Everything else on line
  $/x
  @match_data = parse_regex.match(@content)

  self
end