Class: CiscoAclIntp::AceLogSpec

Inherits:
AceOtherQualifierBase show all
Defined in:
lib/cisco_acl_intp/acespec_other_qualifiers.rb

Overview

Log spec container

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(cookie = nil, input = false) ⇒ AceLogSpec

Constructor

Parameters:

  • cookie (String) (defaults to: nil)

    Log cookie

  • input (Boolean) (defaults to: false)

    set true ‘log-input’ logging



60
61
62
63
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 60

def initialize(cookie = nil, input = false)
  @input = input
  @cookie = cookie
end

Dynamic Method Handling

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

Instance Attribute Details

Parameters:

  • value (String)

    Log cookie

Returns:

  • (String)


46
47
48
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 46

def cookie
  @cookie
end

#inputBoolean Also known as: input?

Specified log-input logging?

Returns:

  • (Boolean)


50
51
52
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 50

def input
  @input
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


77
78
79
80
81
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 77

def ==(other)
  other.instance_of?(AceLogSpec) &&
    @input == other.input &&
    @cookie == other.cookie
end

#to_sString

Generate string for Cisco IOS access list

Returns:

  • (String)


67
68
69
70
71
72
73
# File 'lib/cisco_acl_intp/acespec_other_qualifiers.rb', line 67

def to_s
  format(
    '%s %s',
    @input ? 'log-input' : 'log',
    @cookie ? @cookie : ''
  )
end