Module: Conpar::Directive

Extended by:
Directive
Included in:
Directive
Defined in:
lib/conpar/directive.rb,
lib/conpar/directive/base.rb,
lib/conpar/directive/empty.rb,
lib/conpar/directive/comment.rb,
lib/conpar/directive/access_list.rb,
lib/conpar/directive/access_list/base.rb,
lib/conpar/directive/access_list/remark.rb,
lib/conpar/directive/access_list/extended.rb,
lib/conpar/directive/access_list/web_type.rb,
lib/conpar/directive/access_list/standard.rb,
lib/conpar/directive/access_list/ether_type.rb,
lib/conpar/directive/access_list/unknown_type.rb

Overview

Namespace for any type of configuration directive

Defined Under Namespace

Modules: AccessList Classes: Base, Comment, Empty

Instance Method Summary collapse

Instance Method Details

#new(line, options = {}) ⇒ Object

Parameters:

  • line (String)

    This is the current line being iterated

  • options (Hash) (defaults to: {})

    (common options among all Directives)

  • [Integer] (Hash)

    a customizable set of options


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/conpar/directive.rb', line 13

def new(line, options={})
  [
    Empty,
    Comment,
    # Additional directive classes/modules below
    AccessList
  ].each do |klass|
    if line =~ klass::SIGNATURE
      return klass.new(line, options)
    end
  end

  # Catch-all Directive
  return Base.new(line, options)
end