Class: CiscoAclIntp::ParserErrorHandler
- Inherits:
-
Object
- Object
- CiscoAclIntp::ParserErrorHandler
- Defined in:
- lib/cisco_acl_intp/parser_api.rb
Overview
ACL Parser Error Handler
Instance Attribute Summary collapse
-
#error_count ⇒ Object
readonly
Error count found in parsed file/string.
-
#error_list ⇒ Object
readonly
Error message list found in parsed file/string.
Instance Method Summary collapse
-
#contains_error? ⇒ Boolean
Parsed data contains error or not?.
-
#count ⇒ Object
Count error.
-
#initialize ⇒ ParserErrorHandler
constructor
Constructor.
-
#regist_message(str) ⇒ Object
Regist error messages to list.
-
#reset_count ⇒ Object
Reset error count.
Constructor Details
#initialize ⇒ ParserErrorHandler
Constructor
17 18 19 20 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 17 def initialize @error_count = 0 @error_list = [] end |
Instance Attribute Details
#error_count ⇒ Object (readonly)
Error count found in parsed file/string
12 13 14 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 12 def error_count @error_count end |
#error_list ⇒ Object (readonly)
Error message list found in parsed file/string
14 15 16 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 14 def error_list @error_list end |
Instance Method Details
#contains_error? ⇒ Boolean
Parsed data contains error or not?
41 42 43 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 41 def contains_error? @error_count > 0 end |
#count ⇒ Object
Count error
28 29 30 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 28 def count @error_count += 1 end |
#regist_message(str) ⇒ Object
Regist error messages to list
34 35 36 37 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 34 def (str) count @error_list.push(str) end |
#reset_count ⇒ Object
Reset error count
23 24 25 |
# File 'lib/cisco_acl_intp/parser_api.rb', line 23 def reset_count @error_count = 0 end |