Class: CommandReference::CommandPlatformFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cisco_node_utils/command_reference.rb

Overview

Helper class to match product id with reference files.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fileObject

Returns the value of attribute file.



22
23
24
# File 'lib/cisco_node_utils/command_reference.rb', line 22

def file
  @file
end

#regexObject

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