Class: CommandReference::CommandPlatformFile
- Inherits:
-
Object
- Object
- CommandReference::CommandPlatformFile
- Defined in:
- lib/cisco_node_utils/command_reference.rb
Overview
Helper class to match product id with reference files.
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#regex ⇒ Object
Returns the value of attribute regex.
Instance Method Summary collapse
-
#initialize(match_expression, reference_file) ⇒ CommandPlatformFile
constructor
A new instance of CommandPlatformFile.
- #match(product) ⇒ Object
Constructor Details
#initialize(match_expression, reference_file) ⇒ CommandPlatformFile
Returns a new instance of CommandPlatformFile.
24 25 26 27 |
# File 'lib/cisco_node_utils/command_reference.rb', line 24 def initialize(match_expression, reference_file) self.regex = match_expression self.file = reference_file end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
22 23 24 |
# File 'lib/cisco_node_utils/command_reference.rb', line 22 def file @file end |
#regex ⇒ Object
Returns the value of attribute regex.
22 23 24 |
# File 'lib/cisco_node_utils/command_reference.rb', line 22 def regex @regex end |
Instance Method Details
#match(product) ⇒ Object
45 46 47 |
# File 'lib/cisco_node_utils/command_reference.rb', line 45 def match(product) @regex.match(product) end |